{"modulePath":"github.com/devfile/devworkspace-operator","version":"v1.1.1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package container\n\nPackage container contains library functions for converting DevWorkspace Container components to Kubernetes components\n\nTODO:\n\n  - Devfile API spec is unclear on how mountSources should be handled -- mountPath is assumed to be /projects and volume name is assumed to be \"projects\" see issues:\n  - [https://github.com/devfile/api/issues/290](https://github.com/devfile/api/issues/290)\n  - [https://github.com/devfile/api/issues/291](https://github.com/devfile/api/issues/291)\n\n## Functions\n\n```go\nfunc AnyMountSources(devfileComponents []dw.Component) bool\n```\nAnyMountSources checks HasMountSources for each container component in a devfile. If a component in the slice is not a ContainerComponent, it is ignored.\n\n```go\nfunc GetKubeContainersFromDevfile(\n\tworkspace *dw.DevWorkspaceTemplateSpec,\n\tsecurityContext *corev1.SecurityContext,\n\tpullPolicy string,\n\tdefaultResources *corev1.ResourceRequirements,\n\tresourceCaps *corev1.ResourceRequirements,\n\tpostStartTimeout string,\n\trestrictedFields []string,\n\tpostStartDebugTrapSleepDuration string,\n) (*v1alpha1.PodAdditions, error)\n```\nGetKubeContainersFromDevfile converts container components in a DevWorkspace into Kubernetes containers. If a DevWorkspace container is an init container (i.e. is bound to a preStart event), it will be returned as an init container.\n\nThis function also provisions volume mounts on containers as follows: - Container component's volume mounts are provisioned with the mount path and name specified in the devworkspace However, no Volumes are added to the returned PodAdditions at this stage; the volumeMounts above are expected to be rewritten as Volumes are added to PodAdditions, in order to support e.g. using one PVC to hold all volumes\n\nNote: Requires DevWorkspace to be flattened (i.e. the DevWorkspace contains no Parent or Components of type Plugin)\n\n```go\nfunc HasMountSources(devfileContainer *dw.ContainerComponent) bool\n```\nHasMountSources evaluates whether project sources should be mounted in the given container component. MountSources is by default true for non-plugin components, unless they have dedicatedPod set TODO: - Support dedicatedPod field - Find way to track is container component comes from plugin\n\n","path":"github.com/devfile/devworkspace-operator/pkg/library/container","name":"container","synopsis":"Package container contains library functions for converting DevWorkspace Container components to Kubernetes components","isRedistributable":true}
