Uploaded image for project: 'Red Hat OpenShift Dev Spaces (formerly CodeReady Workspaces) '
  1. Red Hat OpenShift Dev Spaces (formerly CodeReady Workspaces)
  2. CRW-9800

Validate invalid characters in DevWorkspace deployment volume names

XMLWordPrintable

    • False
    • Hide

      None

      Show
      None
    • False
    • Important

      Description of problem:

      • DevWorkspace resource admits invalid Secret/test.pullsecret, leading to failed Deployment.

      Prerequisites (if any, like setup, operators/versions):

      Steps to Reproduce

       

      $> oc -n test-scan-rox  get secret test.pullsecret -o yaml | yq -r .metadata
      creationTimestamp: "2025-12-22T12:04:29Z"
      labels:
        controller.devfile.io/devworkspace_pullsecret: "true"
        controller.devfile.io/mount-to-devworkspace: "true"
        controller.devfile.io/watch-secret: "true"
      name: test.pullsecret
      namespace: test-scan-rox
      resourceVersion: "3014426246"
      uid: d748075b-a98c-4617-9c47-bf09f28230e1
      
      $> oc -n test-scan-rox  get devworkspace
      NAME         DEVWORKSPACE ID             PHASE    INFO
      empty-yisi   workspaceb885a6fa58444b4b   Failed   Error creating DevWorkspace deployment: Deployment.apps "workspaceb885a6fa58444b4b" is invalid: [spec.template.spec.volumes[2].name: Invalid value: "test.pullsecret": must not contain dots, spec.template.spec.containers[0].volumeMounts[3].name: Not found: "test.pullsecret", spec.template.spec.initContainers[0].volumeMounts[3].name: Not found: "test.pullsecret"] 

       

      Actual results:

      • Deployment provisioning fails, when a test.pullsecret secret is set as `.spec.template.spec.volumes[0].name: test.pullsecret
        • As opposed to something like .spec.template.spec.volumes[0].name: test-pullsecret`

      Expected results:

      • The DevWorkspace controller should validate (and mutate) the spec.template.spec.volumes[0].name to replace invalid characters (i.e. dots) for valid ones (i.e. test.pullsecret to test-pullsecret, to avoid ending in a failed state.

       

              dakwon@redhat.com David Kwon
              rhn-support-rsandu Robert Sandu
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: