Documentation ¶
Index ¶
- Constants
- func AddVolumeToContainer(volumeName, volumeMount string, hostConfig *container.HostConfig) *container.HostConfig
- func ComponentExists(client lclient.Client, data data.DevfileData, name string) (bool, error)
- func ConvertEnvs(vars []common.Env) []string
- func ConvertPorts(endpoints []common.Endpoint) nat.PortSet
- 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(componentName string) map[string]string
Constants ¶
const ( // SupervisordVolume is supervisord volume type SupervisordVolume = "supervisord" // ProjectsVolume is project source volume type ProjectsVolume = "projects" )
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 a component exist returns true, if the number of containers equals the number of unique devfile components returns false, if number of containers is zero returns an error, if number of containers is more than zero but does not equal the number of unique devfile components
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 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
Types ¶
This section is empty.