Skip to content

[regression] Deleting a DevWorkspace when there are only two workspaces in a namespace results in the common PVC being deleted. #871

@amisevsk

Description

@amisevsk

Description

When deleting workspaces, the DevWorkspace Operator should delete the common PVC if there are no non-deleted workspaces left in the namespace. However, the check for this is incorrect and will result in DWO treating 1 running workspace and 1 terminating workspace as "no workspaces", causing it to attempt to delete the shared PVC.

Note this issue does not occur if there are more than two workspaces in the current namespace, nor does it occur if there's only one workspace.

This regression was caused by the PR #858

Fixed by #870

How To Reproduce

kubectl apply -f samples/theia-next.yaml
yq '.metadata.name="theia-next-2"' samples/theia-next.yaml | kubectl apply -f -
# wait for workspaces to enter running state
kubectl delete dw theia-next
kubectl get pvc # should not be terminating.

Additional context

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions