Skip to content

Commit

Permalink
Fix issue where deleting a workspace deletes the PVC incorrectly
Browse files Browse the repository at this point in the history
Fix a regression caused by commit cbd3fd1. When deleting workspaces, if
there are no non-terminating workspaces left in the namespace, we delete
the common PVC rather than running cleanup jobs. However, the way the
check was written assumed that we were counting _all_ workspaces, and
would delete the common PVC if there were two workspaces in a namespace
and one was deleted.

Signed-off-by: Angel Misevski <[email protected]>
  • Loading branch information
amisevsk committed Jun 16, 2022
1 parent 033fa05 commit f5d1d31
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/provision/storage/commonStorage.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func (p *CommonStorageProvisioner) CleanupWorkspaceStorage(workspace *dw.DevWork

// If the number of common + async workspaces that exist (started or stopped) is zero,
// delete common PVC instead of running cleanup job
if totalWorkspaces > 1 {
if totalWorkspaces > 0 {
return runCommonPVCCleanupJob(workspace, clusterAPI)
} else {
sharedPVC := &corev1.PersistentVolumeClaim{}
Expand Down

0 comments on commit f5d1d31

Please sign in to comment.