Skip to content

Conversation

@Allda
Copy link
Collaborator

@Allda Allda commented Jan 28, 2026

The NeedsStorage always return false for per-wokrspace storage. This causes an issue and per-workspace workspaces are never backed up.

Moving the check to commonStorage only fixes the issue and still works with empty workspaces.

Fixes: #1575

What does this PR do?

What issues does this PR fix or reference?

Is it tested? How?

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

The NeedsStorage always return false for per-wokrspace storage. This
causes an issue and per-workspace workspaces are never backed up.

Moving the check to commonStorage only fixes the issue and still works
with empty workspaces.

Signed-off-by: Ales Raszka <araszka@redhat.com>
@openshift-ci
Copy link

openshift-ci bot commented Jan 28, 2026

@Allda: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/v14-devworkspace-operator-e2e 2b21d40 link true /test v14-devworkspace-operator-e2e

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@rohanKanojia
Copy link
Member

I tested based on changes in this PR and now all backup cases seem to be passing:

====== Starting DWO Backup Flow Tests ======


====== Workspace Name Prefix: test-devworkspace ======


====== Test 1: Backup with Per-User Storage (External Registry - Quay) ======

Context "rokumar-dev/api-crc-testing:6443/kubeadmin" modified.
Will stop workspace to allow backup : test-devworkspace-should-get-backup
Will keep running workspace to avoid backup : test-devworkspace-no-backup

🔐 Creating quay.io registry secret...
secret/quay-push-secret created
secret/quay-push-secret labeled
✅ Registry secret created and labeled completed.
⚙️  Enabling backup CronJob...
DevWorkspaceOperatorConfig exists, patching...
devworkspaceoperatorconfig.controller.devfile.io/devworkspace-operator-config patched
✅ DevWorkspaceOperatorConfig configured for backup completed.
🚀 Creating DevWorkspaces...
🚀 Applying DevWorkspace manifest...
devworkspace.workspace.devfile.io/test-devworkspace-should-get-backup created
✅ DevWorkspace manifest applied completed.
⏳ Waiting for DevWorkspace 'test-devworkspace-should-get-backup' to become 🟢 *Running*...
devworkspace.workspace.devfile.io/test-devworkspace-should-get-backup condition met
✅ DevWorkspace 'test-devworkspace-should-get-backup' is running completed.
🚀 Applying DevWorkspace manifest...
devworkspace.workspace.devfile.io/test-devworkspace-no-backup created
✅ DevWorkspace manifest applied completed.
⏳ Waiting for DevWorkspace 'test-devworkspace-no-backup' to become 🟢 *Running*...
devworkspace.workspace.devfile.io/test-devworkspace-no-backup condition met
✅ DevWorkspace 'test-devworkspace-no-backup' is running completed.
✅ Both workspaces are running completed.
📝 Modifying README.md in test-devworkspace-should-get-backup...
Defaulted container "dev" out of: dev, project-clone (init), che-code-injector (init)
✅ File modified completed.
🛑 Stopping workspace: test-devworkspace-should-get-backup
devworkspace.workspace.devfile.io/test-devworkspace-should-get-backup patched
✅ Workspace stopped completed.

👀 Monitoring for backup Jobs for 600s...
✅ Backup Job detected for STOPPED workspace: devworkspace-backup-d8twj completed.
job.batch/devworkspace-backup-d8twj condition met
✅ Backup Job completed for stopped workspace completed.

📦 Verifying backup artifact for test-devworkspace-should-get-backup...

💡 NOTE: If verification fails with authentication errors, you may need to make
   the repository public in Quay console at:
   https://quay.io/repository/rokumar/openshift-operators/test-devworkspace-should-get-backup?tab=settings

✅ Backup artifact 📦 exists for stopped workspace completed.

📦 Verifying NO backup artifact for test-devworkspace-no-backup...
✅ No backup artifact 📦 for running workspace completed.

🎉 Backup validation successful
✅ Backup created ONLY for stopped workspace completed.
✅ No backup for running workspace completed.
🗑️  Deleting DevWorkspaces...
devworkspace.workspace.devfile.io "test-devworkspace-should-get-backup" deleted
devworkspace.workspace.devfile.io "test-devworkspace-no-backup" deleted
🗑️  Deleting registry secret...
secret "quay-push-secret" deleted
✅ Cleanup complete completed.
✅ Backup test completed for external registry completed.

====== Test 3: Backup with Per-Workspace Storage (External Registry - Quay) ======

Context "rokumar-dev/api-crc-testing:6443/kubeadmin" modified.
Will stop workspace to allow backup : test-per-workspace-should-get-backup
Will keep running workspace to avoid backup : test-per-workspace-no-backup

🔐 Creating quay.io registry secret...
secret/quay-push-secret created
secret/quay-push-secret labeled
✅ Registry secret created and labeled completed.
⚙️  Enabling backup CronJob...
DevWorkspaceOperatorConfig exists, patching...
devworkspaceoperatorconfig.controller.devfile.io/devworkspace-operator-config patched (no change)
✅ DevWorkspaceOperatorConfig configured for backup completed.
🚀 Creating DevWorkspaces...
🚀 Applying DevWorkspace manifest...
devworkspace.workspace.devfile.io/test-per-workspace-should-get-backup created
✅ DevWorkspace manifest applied completed.
⏳ Waiting for DevWorkspace 'test-per-workspace-should-get-backup' to become 🟢 *Running*...
devworkspace.workspace.devfile.io/test-per-workspace-should-get-backup condition met
✅ DevWorkspace 'test-per-workspace-should-get-backup' is running completed.
🚀 Applying DevWorkspace manifest...
devworkspace.workspace.devfile.io/test-per-workspace-no-backup created
✅ DevWorkspace manifest applied completed.
⏳ Waiting for DevWorkspace 'test-per-workspace-no-backup' to become 🟢 *Running*...
devworkspace.workspace.devfile.io/test-per-workspace-no-backup condition met
✅ DevWorkspace 'test-per-workspace-no-backup' is running completed.
✅ Both workspaces are running completed.
📝 Modifying README.md in test-per-workspace-should-get-backup...
Defaulted container "che-code-runtime-description" out of: che-code-runtime-description, project-clone (init), che-code-injector (init)
✅ File modified completed.
🛑 Stopping workspace: test-per-workspace-should-get-backup
devworkspace.workspace.devfile.io/test-per-workspace-should-get-backup patched
✅ Workspace stopped completed.

👀 Monitoring for backup Jobs for 600s...
✅ Backup Job detected for STOPPED workspace: devworkspace-backup-khhh5 completed.
job.batch/devworkspace-backup-khhh5 condition met
✅ Backup Job completed for stopped workspace completed.

📦 Verifying backup artifact for test-per-workspace-should-get-backup...

💡 NOTE: If verification fails with authentication errors, you may need to make
   the repository public in Quay console at:
   https://quay.io/repository/rokumar/openshift-operators/test-per-workspace-should-get-backup?tab=settings

✅ Backup artifact 📦 exists for stopped workspace completed.

📦 Verifying NO backup artifact for test-per-workspace-no-backup...
✅ No backup artifact 📦 for running workspace completed.

🎉 Backup validation successful
✅ Backup created ONLY for stopped workspace completed.
✅ No backup for running workspace completed.
🗑️  Deleting DevWorkspaces...
devworkspace.workspace.devfile.io "test-per-workspace-should-get-backup" deleted
devworkspace.workspace.devfile.io "test-per-workspace-no-backup" deleted
🗑️  Deleting registry secret...
secret "quay-push-secret" deleted
✅ Cleanup complete completed.
✅ Backup test completed for per-workspace storage completed.

====== Test 5: Backup with Per-User Storage (OpenShift Internal Registry) ======

Context "rokumar-dev/api-crc-testing:6443/kubeadmin" modified.
🔍 Getting OpenShift internal registry route...
✅ Registry route: default-route-openshift-image-registry.apps-crc.testing completed.
Will stop workspace to allow backup : test-devworkspace-should-get-backup
Will keep running workspace to avoid backup : test-devworkspace-no-backup

⚙️  Enabling backup CronJob with OpenShift internal registry...
DevWorkspaceOperatorConfig exists, patching...
devworkspaceoperatorconfig.controller.devfile.io/devworkspace-operator-config patched
✅ DevWorkspaceOperatorConfig configured for backup completed.
🚀 Creating DevWorkspaces...
🚀 Applying DevWorkspace manifest...
devworkspace.workspace.devfile.io/test-devworkspace-should-get-backup created
✅ DevWorkspace manifest applied completed.
⏳ Waiting for DevWorkspace 'test-devworkspace-should-get-backup' to become 🟢 *Running*...
devworkspace.workspace.devfile.io/test-devworkspace-should-get-backup condition met
✅ DevWorkspace 'test-devworkspace-should-get-backup' is running completed.
🚀 Applying DevWorkspace manifest...
devworkspace.workspace.devfile.io/test-devworkspace-no-backup created
✅ DevWorkspace manifest applied completed.
⏳ Waiting for DevWorkspace 'test-devworkspace-no-backup' to become 🟢 *Running*...
devworkspace.workspace.devfile.io/test-devworkspace-no-backup condition met
✅ DevWorkspace 'test-devworkspace-no-backup' is running completed.
✅ Both workspaces are running completed.
📝 Modifying README.md in test-devworkspace-should-get-backup...
Defaulted container "dev" out of: dev, project-clone (init), che-code-injector (init)
✅ File modified completed.
🛑 Stopping workspace: test-devworkspace-should-get-backup
devworkspace.workspace.devfile.io/test-devworkspace-should-get-backup patched
✅ Workspace stopped completed.

👀 Monitoring for backup Jobs for 600s...
✅ Backup Job detected for STOPPED workspace: devworkspace-backup-2wqxh completed.
⏳ Waiting for backup Job to complete...
✅ Backup Job completed for stopped workspace completed.

📦 Verifying backup artifact (ImageStream) for test-devworkspace-should-get-backup...
✅ ImageStream exists for stopped workspace completed.
📋 ImageStream details:
image-registry.openshift-image-registry.svc:5000/openshift-operators/test-devworkspace-should-get-backup

📦 Verifying NO backup artifact for test-devworkspace-no-backup...
✅ No ImageStream for running workspace completed.

🎉 Backup validation successful
✅ Backup created ONLY for stopped workspace completed.
✅ No backup for running workspace completed.
🗑️  Deleting DevWorkspaces...
devworkspace.workspace.devfile.io "test-devworkspace-should-get-backup" deleted
devworkspace.workspace.devfile.io "test-devworkspace-no-backup" deleted
✅ Cleanup complete completed.
✅ Backup test completed with OCP internal registry completed.

====== Test 5: Backup with Per-Workspace Storage (OpenShift Internal Registry) ======

Context "rokumar-dev/api-crc-testing:6443/kubeadmin" modified.
🔍 Getting OpenShift internal registry route...
✅ Registry route: default-route-openshift-image-registry.apps-crc.testing completed.
Will stop workspace to allow backup : test-per-workspace-should-get-backup
Will keep running workspace to avoid backup : test-per-workspace-no-backup

⚙️  Enabling backup CronJob with OpenShift internal registry...
DevWorkspaceOperatorConfig exists, patching...
devworkspaceoperatorconfig.controller.devfile.io/devworkspace-operator-config patched (no change)
✅ DevWorkspaceOperatorConfig configured for backup completed.
🚀 Creating DevWorkspaces...
🚀 Applying DevWorkspace manifest...
devworkspace.workspace.devfile.io/test-per-workspace-should-get-backup created
✅ DevWorkspace manifest applied completed.
⏳ Waiting for DevWorkspace 'test-per-workspace-should-get-backup' to become 🟢 *Running*...
devworkspace.workspace.devfile.io/test-per-workspace-should-get-backup condition met
✅ DevWorkspace 'test-per-workspace-should-get-backup' is running completed.
🚀 Applying DevWorkspace manifest...
devworkspace.workspace.devfile.io/test-per-workspace-no-backup created
✅ DevWorkspace manifest applied completed.
⏳ Waiting for DevWorkspace 'test-per-workspace-no-backup' to become 🟢 *Running*...
devworkspace.workspace.devfile.io/test-per-workspace-no-backup condition met
✅ DevWorkspace 'test-per-workspace-no-backup' is running completed.
✅ Both workspaces are running completed.
📝 Modifying README.md in test-per-workspace-should-get-backup...
Defaulted container "che-code-runtime-description" out of: che-code-runtime-description, project-clone (init), che-code-injector (init)
✅ File modified completed.
🛑 Stopping workspace: test-per-workspace-should-get-backup
devworkspace.workspace.devfile.io/test-per-workspace-should-get-backup patched
✅ Workspace stopped completed.

👀 Monitoring for backup Jobs for 600s...
✅ Backup Job detected for STOPPED workspace: devworkspace-backup-r48nx completed.
⏳ Waiting for backup Job to complete...
✅ Backup Job completed for stopped workspace completed.

📦 Verifying backup artifact (ImageStream) for test-per-workspace-should-get-backup...
✅ ImageStream exists for stopped workspace completed.
📋 ImageStream details:
image-registry.openshift-image-registry.svc:5000/openshift-operators/test-per-workspace-should-get-backup

📦 Verifying NO backup artifact for test-per-workspace-no-backup...
✅ No ImageStream for running workspace completed.

🎉 Backup validation successful
✅ Backup created ONLY for stopped workspace completed.
✅ No backup for running workspace completed.
🗑️  Deleting DevWorkspaces...
devworkspace.workspace.devfile.io "test-per-workspace-should-get-backup" deleted
devworkspace.workspace.devfile.io "test-per-workspace-no-backup" deleted
✅ Cleanup complete completed.
✅ Backup test completed with OCP internal registry completed.

✅ 🎉 All DWO Backup Flow Tests Completed Successfully! completed.

@openshift-ci
Copy link

openshift-ci bot commented Jan 29, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Allda, dkwon17, rohanKanojia

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

The pull request process is described 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

@dkwon17 dkwon17 merged commit 0607887 into main Jan 29, 2026
9 of 10 checks passed
@dkwon17 dkwon17 deleted the 1575 branch January 29, 2026 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Backup functionality does not work for DevWorkspaces using per-workspace storage type.

4 participants