Skip to content

Don't count terminating workspaces when checking shared PVC count - #858

Merged
ibuziuk merged 1 commit into
devfile:mainfrom
amisevsk:ignore-terminating-workspaces-pvc-cleanup
Jun 6, 2022
Merged

Don't count terminating workspaces when checking shared PVC count#858
ibuziuk merged 1 commit into
devfile:mainfrom
amisevsk:ignore-terminating-workspaces-pvc-cleanup

Conversation

@amisevsk

Copy link
Copy Markdown
Collaborator

What does this PR do?

Skips counting terminating workspaces when checking if we can delete the common PVC. This avoids running the cleanup job for each workspaces when running e.g. kubectl delete dw --all.

What issues does this PR fix or reference?

Closes#857

Is it tested? How?

Can be tested via the script from the issue:

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

no jobs should be created.

PR Checklist

  • E2E tests pass (when PR is ready, comment /test v8-devworkspace-operator-e2e, v8-che-happy-path to trigger)
    • v8-devworkspace-operator-e2e: DevWorkspace e2e test
    • v8-che-happy-path: Happy path for verification integration with Che

Since terminating workspaces can't use the shared PVC for storage, it's
safe to ignore them when checking the shared PVC workspace count. This
allows deleting all workspaces in a namespace to work more quickly,
especially when there are a lot of workspaces.
Signed-off-by: Angel Misevski <amisevsk@redhat.com>
@amisevsk
amisevsk requested review from AObuchow and dkwon17June 2, 2022 20:59
@amisevsk
amisevsk requested a review from ibuziuk as a code ownerJune 2, 2022 20:59

@AObuchowAObuchow left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good & tested and verified the patch works as expected :)

@openshift-ci

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: amisevsk, AObuchow, dkwon17, ibuziuk

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cleanup job is run even if all workspaces are deleted

4 participants

@amisevsk@ibuziuk@AObuchow@dkwon17