Documentation ¶
Index ¶
- Constants
- func GetBootstrapperImage() string
- func GetBuildCommand(data data.DevfileData, devfileBuildCmd string) (buildCommand common.DevfileCommand, err error)
- func GetCommandsMap(commands []common.DevfileCommand) map[string]common.DevfileCommand
- func GetComponentEnvVar(env string, envs []common.Env) string
- func GetDebugCommand(data data.DevfileData, devfileDebugCmd string) (debugCommand common.DevfileCommand, err error)
- func GetDevfileContainerComponents(data data.DevfileData) []common.DevfileComponent
- func GetDevfileVolumeComponents(data data.DevfileData) map[string]common.DevfileComponent
- func GetInitCommand(data data.DevfileData, devfileInitCmd string) (initCommand common.DevfileCommand, err error)
- func GetRunCommand(data data.DevfileData, devfileRunCmd string) (runCommand common.DevfileCommand, err error)
- func GetTestCommand(data data.DevfileData, devfileTestCmd string) (runCommand common.DevfileCommand, err error)
- func GetVolumes(devfileObj devfileParser.DevfileObj) map[string][]DevfileVolume
- func IsEnvPresent(envVars []common.Env, envVarName string) bool
- func IsPortPresent(endpoints []common.Endpoint, port int) bool
- func IsRestartRequired(command common.DevfileCommand) bool
- func ValidateAndGetDebugDevfileCommands(data data.DevfileData, devfileDebugCmd string) (pushDebugCommand common.DevfileCommand, err error)
- func ValidateAndGetTestDevfileCommands(data data.DevfileData, devfileTestCmd string) (testCommand common.DevfileCommand, err error)
- type AdapterContext
- type CommandNames
- type ComponentAdapter
- type ComponentInfo
- type DevfileVolume
- type PredefinedDevfileCommands
- type PushCommandsMap
- type PushParameters
- type Storage
- type StorageAdapter
- type SyncParameters
Constants ¶
const ( // DefaultDevfileInitCommand is a predefined devfile command for init DefaultDevfileInitCommand PredefinedDevfileCommands = "devinit" // DefaultDevfileBuildCommand is a predefined devfile command for build DefaultDevfileBuildCommand PredefinedDevfileCommands = "devbuild" // DefaultDevfileRunCommand is a predefined devfile command for run DefaultDevfileRunCommand PredefinedDevfileCommands = "devrun" // DefaultDevfileDebugCommand is a predefined devfile command for debug DefaultDevfileDebugCommand PredefinedDevfileCommands = "debugrun" // SupervisordInitContainerName The init container name for supervisord SupervisordInitContainerName = "copy-supervisord" // SupervisordControlCommand sub command which stands for control SupervisordControlCommand = "ctl" // SupervisordVolumeName Create a custom name and (hope) that users don't use the *exact* same name in their deployment (occlient.go) SupervisordVolumeName = "odo-supervisord-shared-data" // SupervisordMountPath The supervisord Mount Path for the container mounting the supervisord volume SupervisordMountPath = "/opt/odo/" // SupervisordBinaryPath The supervisord binary path inside the container volume mount SupervisordBinaryPath = "/opt/odo/bin/supervisord" // SupervisordConfFile The supervisord configuration file inside the container volume mount SupervisordConfFile = "/opt/odo/conf/devfile-supervisor.conf" // OdoInitImageContents The path to the odo init image contents OdoInitImageContents = "/opt/odo-init/." // BinBash The path to sh executable BinBash = "/bin/sh" // EnvProjectsRoot is the env defined for /projects where component mountSources=true EnvProjectsRoot = "PROJECTS_ROOT" // EnvOdoCommandRunWorkingDir is the env defined in the runtime component container which holds the work dir for the run command EnvOdoCommandRunWorkingDir = "ODO_COMMAND_RUN_WORKING_DIR" // EnvOdoCommandRun is the env defined in the runtime component container which holds the run command to be executed EnvOdoCommandRun = "ODO_COMMAND_RUN" // EnvOdoCommandDebugWorkingDir is the env defined in the runtime component container which holds the work dir for the debug command EnvOdoCommandDebugWorkingDir = "ODO_COMMAND_DEBUG_WORKING_DIR" // EnvOdoCommandDebug is the env defined in the runtime component container which holds the debug command to be executed EnvOdoCommandDebug = "ODO_COMMAND_DEBUG" // EnvDebugPort is the env defined in the runtime component container which holds the debug port for remote debugging EnvDebugPort = "DEBUG_PORT" // ShellExecutable is the shell executable ShellExecutable = "/bin/sh" // SupervisordCtlSubCommand is the supervisord sub command ctl SupervisordCtlSubCommand = "ctl" )
Variables ¶
This section is empty.
Functions ¶
func GetBootstrapperImage ¶ added in v1.1.2
func GetBootstrapperImage() string
GetBootstrapperImage returns the odo-init bootstrapper image
func GetBuildCommand ¶ added in v1.1.2
func GetBuildCommand(data data.DevfileData, devfileBuildCmd string) (buildCommand common.DevfileCommand, err error)
GetBuildCommand iterates through the components in the devfile and returns the build command
func GetCommandsMap ¶ added in v1.2.5
func GetCommandsMap(commands []common.DevfileCommand) map[string]common.DevfileCommand
GetCommandsMap returns a mapping of all of devfile command names to their corresponding DevfileCommand struct Allowing us to easily retrieve the DevfileCommand of any command listed in a composite command
func GetComponentEnvVar ¶ added in v1.2.5
GetComponentEnvVar returns true if a list of env vars contains the specified env var If the env exists, it returns the value of it
func GetDebugCommand ¶ added in v1.2.3
func GetDebugCommand(data data.DevfileData, devfileDebugCmd string) (debugCommand common.DevfileCommand, err error)
GetDebugCommand iterates through the components in the devfile and returns the debug command
func GetDevfileContainerComponents ¶ added in v1.2.5
func GetDevfileContainerComponents(data data.DevfileData) []common.DevfileComponent
GetDevfileContainerComponents iterates through the components in the devfile and returns a list of devfile container components
func GetDevfileVolumeComponents ¶ added in v1.2.5
func GetDevfileVolumeComponents(data data.DevfileData) map[string]common.DevfileComponent
GetDevfileVolumeComponents iterates through the components in the devfile and returns a map of devfile volume components
func GetInitCommand ¶ added in v1.2.1
func GetInitCommand(data data.DevfileData, devfileInitCmd string) (initCommand common.DevfileCommand, err error)
GetInitCommand iterates through the components in the devfile and returns the init command
func GetRunCommand ¶ added in v1.1.2
func GetRunCommand(data data.DevfileData, devfileRunCmd string) (runCommand common.DevfileCommand, err error)
GetRunCommand iterates through the components in the devfile and returns the run command
func GetTestCommand ¶ added in v1.2.4
func GetTestCommand(data data.DevfileData, devfileTestCmd string) (runCommand common.DevfileCommand, err error)
GetTestCommand iterates through the components in the devfile and returns the test command
func GetVolumes ¶ added in v1.2.0
func GetVolumes(devfileObj devfileParser.DevfileObj) map[string][]DevfileVolume
GetVolumes iterates through the components in the devfile and returns a map of container name to the devfile volumes
func IsEnvPresent ¶ added in v1.2.0
IsEnvPresent checks if the env variable is present in an array of env variables
func IsPortPresent ¶ added in v1.2.0
IsPortPresent checks if the port is present in the endpoints array
func IsRestartRequired ¶ added in v1.2.1
func IsRestartRequired(command common.DevfileCommand) bool
IsRestartRequired returns if restart is required for devrun command
func ValidateAndGetDebugDevfileCommands ¶ added in v1.2.3
func ValidateAndGetDebugDevfileCommands(data data.DevfileData, devfileDebugCmd string) (pushDebugCommand common.DevfileCommand, err error)
ValidateAndGetDebugDevfileCommands validates the debug command
func ValidateAndGetTestDevfileCommands ¶ added in v1.2.4
func ValidateAndGetTestDevfileCommands(data data.DevfileData, devfileTestCmd string) (testCommand common.DevfileCommand, err error)
ValidateAndGetTestDevfileCommands validates the test command
Types ¶
type AdapterContext ¶
type AdapterContext struct { ComponentName string // ComponentName is the odo component name, it is NOT related to any devfile components Context string // Context is the given directory containing the source code and configs AppName string // the application name associated to a component Devfile devfileParser.DevfileObj // Devfile is the object returned by the Devfile parser }
AdapterContext is a construct that is common to all adapters
type CommandNames ¶ added in v1.2.1
CommandNames is a struct to store the default and adapter names for devfile commands
type ComponentAdapter ¶
type ComponentAdapter interface { Push(parameters PushParameters) error DoesComponentExist(cmpName string) (bool, error) Delete(labels map[string]string) error Test(testCmd string, show bool) error Log(follow, debug bool) (io.ReadCloser, error) Exec(command []string) error }
ComponentAdapter defines the functions that platform-specific adapters must implement
type ComponentInfo ¶ added in v1.2.0
ComponentInfo is a struct that holds information about a component i.e.; pod name, container name, and source mount (if applicable)
type DevfileVolume ¶
DevfileVolume is a struct for Devfile volume that is common to all the adapters
type PredefinedDevfileCommands ¶ added in v1.1.2
type PredefinedDevfileCommands string
PredefinedDevfileCommands encapsulates constants for predefined devfile commands
type PushCommandsMap ¶ added in v1.2.2
type PushCommandsMap map[common.DevfileCommandGroupType]common.DevfileCommand
PushCommandsMap stores the commands to be executed as per their types.
func NewPushCommandMap ¶ added in v1.2.2
func NewPushCommandMap() PushCommandsMap
NewPushCommandMap returns the instance of PushCommandsMap
func ValidateAndGetPushDevfileCommands ¶ added in v1.1.2
func ValidateAndGetPushDevfileCommands(data data.DevfileData, devfileInitCmd, devfileBuildCmd, devfileRunCmd string) (commandMap PushCommandsMap, err error)
ValidateAndGetPushDevfileCommands validates the build and the run command, if provided through odo push or else checks the devfile for devBuild and devRun. It returns the build and run commands if its validated successfully, error otherwise.
type PushParameters ¶ added in v1.1.2
type PushParameters struct { Path string // Path refers to the parent folder containing the source code to push up to a component WatchFiles []string // Optional: WatchFiles is the list of changed files detected by odo watch. If empty or nil, odo will check .odo/odo-file-index.json to determine changed files WatchDeletedFiles []string // Optional: WatchDeletedFiles is the list of deleted files detected by odo watch. If empty or nil, odo will check .odo/odo-file-index.json to determine deleted files IgnoredFiles []string // IgnoredFiles is the list of files to not push up to a component ForceBuild bool // ForceBuild determines whether or not to push all of the files up to a component or just files that have changed, added or removed. Show bool // Show tells whether the devfile command output should be shown on stdout DevfileInitCmd string // DevfileInitCmd takes the init command through the command line and overwrites devfile init command DevfileBuildCmd string // DevfileBuildCmd takes the build command through the command line and overwrites devfile build command DevfileRunCmd string // DevfileRunCmd takes the run command through the command line and overwrites devfile run command DevfileDebugCmd string // DevfileDebugCmd takes the debug command through the command line and overwrites the devfile debug command EnvSpecificInfo envinfo.EnvSpecificInfo // EnvSpecificInfo contains infomation of env.yaml file Debug bool // Runs the component in debug mode DebugPort int // Port used for remote debugging }
PushParameters is a struct containing the parameters to be used when pushing to a devfile component
type Storage ¶
type Storage struct { Name string Volume DevfileVolume }
Storage is a struct that is common to all the adapters
type StorageAdapter ¶
StorageAdapter defines the storage functions that platform-specific adapters must implement
type SyncParameters ¶ added in v1.2.0
type SyncParameters struct { PushParams PushParameters CompInfo ComponentInfo PodChanged bool ComponentExists bool }
SyncParameters is a struct containing the parameters to be used when syncing a devfile component