utils

package
v1.2.6 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
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

func ComponentExists(client lclient.Client, data data.DevfileData, name string) (bool, error)

ComponentExists checks if a component exist returns true, if the number of containers equals the number of unique devfile container 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 container components

func ConvertEnvs

func ConvertEnvs(vars []common.Env) []string

ConvertEnvs converts environment variables from the devfile structure to an array of strings, as expected by Docker

func ConvertPorts added in v1.2.0

func ConvertPorts(endpoints []common.Endpoint) nat.PortSet

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

func GetContainerIDForAlias(containers []types.Container, alias string) string

GetContainerIDForAlias returns the container ID for the devfile alias from a list of containers

func GetContainerLabels added in v1.2.0

func GetContainerLabels(componentName, alias string) map[string]string

GetContainerLabels returns the label selectors used to retrieve/create the component container

func GetProjectVolumeLabels

func GetProjectVolumeLabels(componentName string) map[string]string

GetProjectVolumeLabels returns the label selectors used to retrieve the project/source volume for a given component

func GetSupervisordVolumeLabels added in v1.2.0

func GetSupervisordVolumeLabels(componentName string) map[string]string

GetSupervisordVolumeLabels returns the label selectors used to retrieve the supervisord volume

Types

This section is empty.

Jump to

Keyboard shortcuts

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