Skip to content

Cleanup job is run even if all workspaces are deleted #857

Description

@amisevsk

Description

Since #826, the shared PVC should be deleted when no workspaces that use it exist. However, if there are multiple workspaces that use the common PVC deleted at the same time, they will each instead run the cleanup job.

Once all but one cleanup job completes, DWO deletes the shared PVC as expected and removes the finalizer from the last workspace, even if the cleanup job is not complete.

How To Reproduce

foriin {1..5};do
yq --arg i "$i"'.metadata.name="theia-next-\($i)"' samples/theia-next.yaml | kubectl apply -f -
sleep 2s
kubectl patch dw "theia-next-$i" --type merge -p '{"spec": {"started": false}}'done
kubectl delete dw --all --wait=false && kubectl get jobs -w

Expected behavior

If all workspaces that depend on common storage are being terminated, we can just delete the PVC and remove their finalizers.

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