Skip to content

Commit 0607887

Browse files
Alldadkwon17
authored andcommitted
Fix: check for empty storage in common storage provisioner
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>
1 parent caaa0a1 commit 0607887

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pkg/library/storage/storage.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,16 @@ func GetWorkspacePVCInfo(
4949
if err != nil {
5050
return "", "", err
5151
}
52-
if !storageProvisioner.NeedsStorage(&workspace.Spec.Template) {
53-
// No storage provisioned for this workspace
54-
return "", "", nil
55-
}
5652

5753
if _, ok := storageProvisioner.(*storage.PerWorkspaceStorageProvisioner); ok {
5854
pvcName := common.PerWorkspacePVCName(workspace.Status.DevWorkspaceId)
5955
return pvcName, constants.DefaultProjectsSourcesRoot, nil
6056

6157
} else if _, ok := storageProvisioner.(*storage.CommonStorageProvisioner); ok {
58+
if !storageProvisioner.NeedsStorage(&workspace.Spec.Template) {
59+
// No storage provisioned for this workspace
60+
return "", "", nil
61+
}
6262
pvcName := constants.DefaultWorkspacePVCName
6363
if config.Workspace != nil && config.Workspace.PVCName != "" {
6464
pvcName = config.Workspace.PVCName

0 commit comments

Comments
 (0)