...

Source file src/github.com/redhat-developer/odo/pkg/devfile/validate/errors.go

Documentation: github.com/redhat-developer/odo/pkg/devfile/validate

     1  package validate
     2  
     3  import (
     4  	"fmt"
     5  
     6  	devfilev1 "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2"
     7  )
     8  
     9  // NoComponentsError returns an error if no component is found
    10  type NoComponentsError struct {
    11  }
    12  
    13  func (e *NoComponentsError) Error() string {
    14  	return "no components present"
    15  }
    16  
    17  // NoContainerComponentError returns an error if no container component is found
    18  type NoContainerComponentError struct {
    19  }
    20  
    21  func (e *NoContainerComponentError) Error() string {
    22  	return fmt.Sprintf("odo requires atleast one component of type '%s' in devfile", devfilev1.ContainerComponentType)
    23  }
    24  
    25  // UnsupportedOdoCommandError returns an error if the command is neither exec nor composite
    26  type UnsupportedOdoCommandError struct {
    27  	commandId string
    28  }
    29  
    30  func (e *UnsupportedOdoCommandError) Error() string {
    31  	return fmt.Sprintf("command %q must be of type \"exec\" or \"composite\"", e.commandId)
    32  }
    33  

View as plain text