validation

package
v2.0.0-...-01444cd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2021 License: EPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// EnvProjectsSrc is the env defined for path to the project source in a component container
	EnvProjectsSrc = "PROJECT_SOURCE"

	// EnvProjectsRoot is the env defined for project mount in a component container when component's mountSources=true
	EnvProjectsRoot = "PROJECTS_ROOT"
)

Variables

This section is empty.

Functions

func ValidateCommands

func ValidateCommands(commands []v1alpha2.Command, components []v1alpha2.Component) (err error)

ValidateCommands validates the devfile commands and checks: 1. there are no duplicate command ids 2. the command type is not invalid 3. if a command is part of a command group, there is a single default command

func ValidateComponents

func ValidateComponents(components []v1alpha2.Component) error

ValidateComponents validates that the components 1. makes sure the container components reference a valid volume component if it uses volume mounts 2. makes sure the volume components are unique 3. checks the URI specified in openshift components and kubernetes components are with valid format 4. makes sure the component name is unique

func ValidateEvents

func ValidateEvents(events v1alpha2.Events, commands []v1alpha2.Command) error

ValidateEvents validates all the devfile events

func ValidateProjects

func ValidateProjects(projects []v1alpha2.Project) error

ValidateProjects checks if the project has more than one remote configured then a checkout remote is mandatory and if the checkout remote matches the renote configured

func ValidateStarterProjects

func ValidateStarterProjects(starterProjects []v1alpha2.StarterProject) error

ValidateStarterProjects checks if starter project has only one remote configured and if the checkout remote matches the renote configured

func ValidateURI

func ValidateURI(uri string) error

ValidateURI checks if the string is with valid uri format, return error if not valid

Types

type InvalidCommandError

type InvalidCommandError struct {
	// contains filtered or unexported fields
}

InvalidCommandError returns an error if the command is invalid

func (*InvalidCommandError) Error

func (e *InvalidCommandError) Error() string

type InvalidComponentError

type InvalidComponentError struct {
	// contains filtered or unexported fields
}

InvalidComponentError returns an error if the component is invalid

func (*InvalidComponentError) Error

func (e *InvalidComponentError) Error() string

type InvalidEndpointError

type InvalidEndpointError struct {
	// contains filtered or unexported fields
}

InvalidEndpointError returns an error if the component endpoint is invalid

func (*InvalidEndpointError) Error

func (e *InvalidEndpointError) Error() string

type InvalidEventError

type InvalidEventError struct {
	// contains filtered or unexported fields
}

InvalidEventError returns an error if the devfile event type has invalid events

func (*InvalidEventError) Error

func (e *InvalidEventError) Error() string

type InvalidVolumeError

type InvalidVolumeError struct {
	// contains filtered or unexported fields
}

InvalidVolumeError returns an error if the volume is invalid

func (*InvalidVolumeError) Error

func (e *InvalidVolumeError) Error() string

type MissingVolumeMountError

type MissingVolumeMountError struct {
	// contains filtered or unexported fields
}

MissingVolumeMountError returns an error if the container volume mount does not reference a valid volume component

func (*MissingVolumeMountError) Error

func (e *MissingVolumeMountError) Error() string

type ReservedEnvError

type ReservedEnvError struct {
	// contains filtered or unexported fields
}

ReservedEnvError returns an error if the user attempts to customize a reserved ENV in a container

func (*ReservedEnvError) Error

func (e *ReservedEnvError) Error() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL