Skip to content

feat: Mounting PVC into Workspace within Subpath#1595

Open
tolusha wants to merge 2 commits intomainfrom
23683
Open

feat: Mounting PVC into Workspace within Subpath#1595
tolusha wants to merge 2 commits intomainfrom
23683

Conversation

@tolusha
Copy link
Contributor

@tolusha tolusha commented Feb 23, 2026

What does this PR do?

  • Introduces a new annotation controller.devfile.io/mount-sub-path that can be set on PVCs labeled for automounting (controller.devfile.io/mount-to-devworkspace: "true").
  • When this annotation is present, the PVC volume mount uses the specified subPath, mounting a subdirectory within the PVC instead of the root.

What issues does this PR fix or reference?

eclipse-che/che#23683

Is it tested? How?

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  annotations:
    controller.devfile.io/mount-path: /home/user/subpath
    controller.devfile.io/mount-sub-path: subpath
  labels:
    controller.devfile.io/mount-to-devworkspace: "true"
  name: devworkspace-subpath
  namespace: admin-che
spec:
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 10Gi

PR Checklist

  • E2E tests pass (when PR is ready, comment /test v8-devworkspace-operator-e2e, v8-che-happy-path to trigger)
    • v8-devworkspace-operator-e2e: DevWorkspace e2e test
    • v8-che-happy-path: Happy path for verification integration with Che

Signed-off-by: Anatolii Bazko <abazko@redhat.com>
Signed-off-by: Anatolii Bazko <abazko@redhat.com>
@openshift-ci openshift-ci bot removed the lgtm label Feb 24, 2026
Copy link
Member

@rohanKanojia rohanKanojia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and works as expected!

oc get pod workspace4e61cbe77de44f3c-8686d5c5fc-lcg2g \                                             devfile/devworkspace-operator (pullRequest1595 ⚡) rohan-20y4s1qe0p
  -n openshift-operators \
  -o jsonpath='{.spec.containers[0].volumeMounts[?(@.name=="devworkspace-subpath")]}{"\n"}'        
{"mountPath":"/home/user/subpath","name":"devworkspace-subpath","subPath":"subpath"}

@openshift-ci
Copy link

openshift-ci bot commented Feb 24, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: akurinnoy, rohanKanojia, tolusha
Once this PR has been reviewed and has the lgtm label, please assign dkwon17 for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants