Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Home persistence should be disabled if ephemeral storage strategy is used #1203

Closed
AObuchow opened this issue Nov 16, 2023 · 0 comments
Closed
Assignees
Labels
bug Something isn't working
Milestone

Comments

@AObuchow
Copy link
Collaborator

AObuchow commented Nov 16, 2023

Description

If a devworkspace uses the ephemeral storage strategy, and the DWOC's field workspace.persistUserHome: true is set, then the devworkspace's deployment spec will be invalid because it will contain a volume named persistentHome, which is an invalid volume name in kubernetes (see #1200). Even if the persistent home volume name was valid, the persistent home volume should not be injected into the devworkspace: an ephemeral storage workspace cannot have it's home directory persisted.

When we check if home persistence is enabled, we should also ensure persist storage is being used as well.

How To Reproduce

  1. Set workspace.persistUserHome: true in the DWOC
  2. Apply a devworkspace with ephemeral storage, eg:
kind: DevWorkspace
apiVersion: workspace.devfile.io/v1alpha2
metadata:
  name: plain-devworkspace-ephemeral
spec:
  started: true
  routingClass: 'basic'
  template:
    attributes:
        controller.devfile.io/storage-type: ephemeral
    components:
      - name: web-terminal
        container:
          image: quay.io/wto/web-terminal-tooling:next
          memoryRequest: 256Mi
          memoryLimit: 512Mi
          mountSources: true
          command:
           - "tail"
           - "-f"
           - "/dev/null"
  1. Check the workspace status (i.e. kubectl get dw -n $NAMESPACE) and see that the workspace has failed:
NAME                           DEVWORKSPACE ID             PHASE    INFO  
plain-devworkspace-ephemeral   workspace79f813e0f75a42f4   Failed   Error creating DevWorkspace deployment: Deployment.apps "workspace79f813e0f75a42f4" is invalid: [spec.template.spec.volumes[0].name: Invalid value: "persistentHome": a lowercase RFC 1123 label must consist of lower case alphanumeric characters or '-', and must start and end  
with an alphanumeric character (e.g. 'my-name',  or '123-abc', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?'), spec.template.spec.containers[0].volumeMounts[0].name: Not found: "persistentHome"]

Expected behavior

The workspace deployment succeeds and no persistent home volume is added to the workspace deployment's volumes or volumeMounts.

Additional context

Related upstream issue

@AObuchow AObuchow added the bug Something isn't working label Nov 16, 2023
@AObuchow AObuchow self-assigned this Nov 16, 2023
AObuchow added a commit to AObuchow/devworkspace-operator that referenced this issue Nov 23, 2023
AObuchow added a commit to AObuchow/devworkspace-operator that referenced this issue Nov 23, 2023
@AObuchow AObuchow added this to the v0.25.x milestone Jan 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant