Documentation
¶
Overview ¶
Copyright (c) 2019-2021 Red Hat, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Package container contains library functions for converting DevWorkspace Container components to Kubernetes components
TODO:
- 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:
- https://github.com/devfile/api/issues/290
- https://github.com/devfile/api/issues/291
Copyright (c) 2019-2021 Red Hat, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2019-2021 Red Hat, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AnyMountSources ¶
AnyMountSources checks HasMountSources for each container component in a devfile. If a component in the slice is not a ContainerComponent, it is ignored.
func GetKubeContainersFromDevfile ¶
func GetKubeContainersFromDevfile(workspace *dw.DevWorkspaceTemplateSpec) (*v1alpha1.PodAdditions, error)
GetKubeContainersFromDevfile 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.
This 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
Note: Requires DevWorkspace to be flattened (i.e. the DevWorkspace contains no Parent or Components of type Plugin)
func HasMountSources ¶
func HasMountSources(devfileContainer *dw.ContainerComponent) bool
HasMountSources 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
Types ¶
This section is empty.