Skip to content

BackupCronJob Controller fails for empty DevWorkspace (no PVC) #1555

@rohanKanojia

Description

@rohanKanojia

Description

The DevWorkspace backup feature works correctly for workspaces with claim-devworkspace PVCs.

However, when a DevWorkspace has an empty template and no PVCs, the backup cron job fails with an error instead of completing successfully or skipping the backup gracefully.

{"level":"error","ts":"2025-12-31T15:52:00Z","logger":"controllers.BackupCronJob","msg":"Failed to get PVC for DevWorkspace","id":"workspacedffe6504447347e7","error":"PersistentVolumeClaim \"claim-devworkspace\" not found","stacktrace":"github.com/devfile/devworkspace-operator/controllers/backupcronjob.(*BackupCronJobReconciler).createBackupJob\n\t/devworkspace-operator/controllers/backupcronjob/backupcronjob_controller.go:367\n..."}

How To Reproduce

  1. Enable Backup functionality by applying this DevWorkspaceOperatorConfig (see feat(23570): Add controller for workspace backup #1530 (comment) )
  2. Create empty workspace sample from samples/empty.yaml
  3. Check DevWorkspaceOperator controller pod logs to see the error

Expected behavior

BackupCronJob should handle empty DevWorkspaces gracefully. Either:

  • Skip backup and log an info message, or
  • Create a valid empty backup artifact
  • Avoid treating missing PVCs as an error when none are expected

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions