Closed
Description
Description
Container components can specify mountSources: true
to enable mounting the project repos into the container. Currently, sources are mounted at the path /projects
, which leave the potential for a collision if a devfile specifies volumeMount to /projects
directly -- e.g. the DevWorkspace
kind: DevWorkspace
apiVersion: workspace.devfile.io/v1alpha2
metadata:
name: projects-volumeMount
spec:
started: true
template:
components:
- name: testing-container
container:
image: quay.io/fedora/fedora:34
mountSources: true # Default value
volumeMounts:
- path: "/projects"
name: my-volume
is at least ambiguous -- default behaviour would be to provision a container with conflicting volumeMounts on the /projects
path.
Required Changes
Option 1
- Use random mountPath (based on workspace UID) for
mountSources
and expect editors, etc. to respect$PROJECTS_ROOT
env var.
Option 2
- Specify that
/projects
is a reserved volumeMount path, (unlessmountSources
is explicitlyfalse
?)
Relevant API docs
The API documentation for mountSources
:
mountSources: boolean
Toggles whether or not the project source code should be mounted in the component.
Defaults to true for all component types except plugins and components that set dedicatedPod to true.
The API documentation for volumeMounts
:
// Volume that should be mounted to a component container
type VolumeMount struct {
// The volume mount name is the name of an existing `Volume` component.
// If several containers mount the same volume name
// then they will reuse the same volume and will be able to access to the same files.
Name string `json:"name"`
// The path in the component container where the volume should be mounted.
// If not path is mentioned, default path is the is `/<name>`.
// +optional
Path string `json:"path,omitempty"`
}
Metadata
Metadata
Assignees
Labels
No labels