Documentation ¶
Index ¶
- func AddVolumeToContainer(volumeName, volumeMount string, hostConfig *container.HostConfig) *container.HostConfig
- func ComponentExists(client lclient.Client, name string) bool
- func ConvertEnvs(vars []common.Env) []string
- func ConvertPorts(endpoints []common.Endpoint) nat.PortSet
- func CreateAndInitSupervisordVolume(client lclient.Client) (string, error)
- func DoesContainerNeedUpdating(component common.DevfileComponent, containerConfig *container.Config, ...) bool
- func GetComponentContainers(client lclient.Client, componentName string) (containers []types.Container, err error)
- func GetContainerIDForAlias(containers []types.Container, alias string) string
- func GetContainerLabels(componentName, alias string) map[string]string
- func GetProjectVolumeLabels(componentName string) map[string]string
- func GetSupervisordVolumeLabels() map[string]string
- func StartBootstrapSupervisordInitContainer(client lclient.Client, supervisordVolumeName string) error
- func UpdateComponentWithSupervisord(comp *common.DevfileComponent, runCommand common.DevfileCommand, ...)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddVolumeToContainer ¶ added in v1.2.0
func AddVolumeToContainer(volumeName, volumeMount string, hostConfig *container.HostConfig) *container.HostConfig
AddVolumeToContainer adds the volume name and mount to the container host config
func ComponentExists ¶
ComponentExists checks if Docker containers labeled with the specified component name exists
func ConvertEnvs ¶
ConvertEnvs converts environment variables from the devfile structure to an array of strings, as expected by Docker
func ConvertPorts ¶ added in v1.2.0
ConvertPorts converts endpoints from the devfile structure to PortSet, which is expected by Docker
func CreateAndInitSupervisordVolume ¶ added in v1.2.0
CreateAndInitSupervisordVolume creates the supervisord volume and initializes it with supervisord bootstrap image - assembly files and supervisord binary
func DoesContainerNeedUpdating ¶
func DoesContainerNeedUpdating(component common.DevfileComponent, containerConfig *container.Config, hostConfig *container.HostConfig, devfileMounts []mount.Mount, containerMounts []types.MountPoint, portMap nat.PortMap) bool
DoesContainerNeedUpdating returns true if a given container needs to be removed and recreated This function compares values in the container vs corresponding values in the devfile component. If any of the values between the two differ, a restart is required (and this function returns true) Unlike Kube, Docker doesn't provide a mechanism to update a container in place only when necesary so this function is necessary to prevent having to restart the container on every odo pushs
func GetComponentContainers ¶ added in v1.2.0
func GetComponentContainers(client lclient.Client, componentName string) (containers []types.Container, err error)
GetComponentContainers returns a list of the running component containers
func GetContainerIDForAlias ¶ added in v1.2.0
GetContainerIDForAlias returns the container ID for the devfile alias from a list of containers
func GetContainerLabels ¶ added in v1.2.0
GetContainerLabels returns the label selectors used to retrieve/create the component container
func GetProjectVolumeLabels ¶
GetProjectVolumeLabels returns the label selectors used to retrieve the project/source volume for a given component
func GetSupervisordVolumeLabels ¶ added in v1.2.0
GetSupervisordVolumeLabels returns the label selectors used to retrieve the supervisord volume
func StartBootstrapSupervisordInitContainer ¶ added in v1.2.0
func StartBootstrapSupervisordInitContainer(client lclient.Client, supervisordVolumeName string) error
StartBootstrapSupervisordInitContainer pulls the supervisord bootstrap image, mounts the supervisord volume, starts the bootstrap container and initializes the supervisord volume via its entrypoint
func UpdateComponentWithSupervisord ¶ added in v1.2.0
func UpdateComponentWithSupervisord(comp *common.DevfileComponent, runCommand common.DevfileCommand, supervisordVolumeName string, hostConfig *container.HostConfig)
UpdateComponentWithSupervisord updates the devfile component's 1. command and args with supervisord, if absent 2. env with ODO_COMMAND_RUN and ODO_COMMAND_RUN_WORKING_DIR, if absent
Types ¶
This section is empty.