devfile / devworkspace-operator

Apache License 2.0
59 stars 50 forks source link

persistentHome volume name should not use upper-case letters #1200

Closed AObuchow closed 7 months ago

AObuchow commented 8 months ago

If the DWOC's workspace.persistUserHome: true field is set, then a devfile volume named persistentHome will be injected into the devworkspace. The name of this volume should not include any upper-case letters, as this would be an invalid devfile component volume name (i.e. it doesn't match the following regex).

For example, the following devworkspace would fail to start due to kubebuilder/webhook validation:

kind: DevWorkspace
apiVersion: workspace.devfile.io/v1alpha2
metadata:
  name: plain-devworkspace
spec:
  started: true
  routingClass: 'basic'
  template:
    components:
      - name: web-terminal
        container:
          image: quay.io/wto/web-terminal-tooling:next
          memoryRequest: 256Mi
          memoryLimit: 512Mi
          mountSources: true
          command:
           - "tail"
           - "-f"
           - "/dev/null"
          volumeMounts:
            - name: persistentHome
              path: /home/user/
      - name: persistentHome
        volume: {}

However, when persistUserHome is enabled in DWO, the devworkspace object will contain a volume named persistentHome.

The persistentHome volume should instead be renamed to persistent-home.