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

Prevent users from changing controller.devfile.io/storage-type on an existing workspace to avoid confusing & frustrating data loss #23035

Closed
etsauer opened this issue Jul 11, 2024 · 1 comment
Labels
area/editor/vscode Issues related to the Code OSS editor of Che kind/bug Outline of a bug - must adhere to the bug report template. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. severity/P1 Has a major impact to usage or development of the system. team/B This team is responsible for the Web Terminal, the DevWorkspace Operator and the IDEs.

Comments

@etsauer
Copy link

etsauer commented Jul 11, 2024

Describe the bug

When I go to start a new workspace from scratch, I often follow a workflow like this:

  1. Create a new workspace from a git repo (that has no devfile) OR click the "Empty workspace" sample tile, and then clone a repo
  2. Create a new devfile in the workspace IDE, usually by copying & modifying an existing one that I like
  3. Clicking "Restart workspace from local devfile"

In general this is a great workflow for getting started working on a new project. However occasionally I would get a behavior that was frustrating/unexpected... after that first "Restart workspace from local devfile", my data would get wiped. No repo in /projects, and any other work I had done that I normally expect to persist would be gone.

Eventually I realized that what was happening was that I had inadvertently copy/pasted a devfile that had this config in it:

attributes:
  controller.devfile.io/storage-type: per-workspace

And if I was working in a che-cluster that defaults to "per-user", the result of the restart would be that I would get a brand new PVC on restart, and all my work was missing.

I'm not sure if the right solution here would be to prevent that change, or issue a warning, but I could see this being a huge turn-off to new users trying to get started, and I think we should do something about it

Che version

7.81

Steps to reproduce

  1. Create an empty workspace using the "Empty workspace" sample in a che cluster with default configuration
  2. Clone a repo or add some content to /projects. (e.g. touch /projects/testfile)
  3. Create a new devfile.yaml with the following content:
schemaVersion: 2.2.0
attributes:
  controller.devfile.io/storage-type: per-workspace
metadata:
  name: devspaces-images
components:
- name: dev-tools
  container:
    image: quay.io/redhat-cop/cekit-builder:latest
  1. Click the "Restart workspace form local devfile" option from the IDE
  2. After restart, see that your files are gone (e.g. ls /projects/testfile)

Expected behavior

I would like to be issued a warning of some kind that the devfile is changing the storage type that will result in data loss, or maybe just prevent the change from happening alltogether

Runtime

OpenShift

Screenshots

No response

Installation method

OperatorHub

Environment

Linux

Eclipse Che Logs

No response

Additional context

No response

@etsauer etsauer added the kind/bug Outline of a bug - must adhere to the bug report template. label Jul 11, 2024
@che-bot che-bot added the status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. label Jul 11, 2024
@RomanNikitenko RomanNikitenko added area/editor/vscode Issues related to the Code OSS editor of Che team/B This team is responsible for the Web Terminal, the DevWorkspace Operator and the IDEs. severity/P1 Has a major impact to usage or development of the system. and removed status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. labels Jul 15, 2024
@RomanNikitenko RomanNikitenko moved this to 📋 Backlog (not in current Sprint) in Eclipse Che Team B Backlog Jul 15, 2024
@che-bot
Copy link
Contributor

che-bot commented Jan 11, 2025

Issues go stale after 180 days of inactivity. lifecycle/stale issues rot after an additional 7 days of inactivity and eventually close.

Mark the issue as fresh with /remove-lifecycle stale in a new comment.

If this issue is safe to close now please do so.

Moderators: Add lifecycle/frozen label to avoid stale mode.

@che-bot che-bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 11, 2025
@che-bot che-bot closed this as completed Jan 18, 2025
@github-project-automation github-project-automation bot moved this from 📋 Backlog (not in current Sprint) to ✅ Done in Eclipse Che Team B Backlog Jan 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/editor/vscode Issues related to the Code OSS editor of Che kind/bug Outline of a bug - must adhere to the bug report template. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. severity/P1 Has a major impact to usage or development of the system. team/B This team is responsible for the Web Terminal, the DevWorkspace Operator and the IDEs.
Projects
Status: ✅ Done
Development

No branches or pull requests

3 participants