Closed mkuznyetsov closed 1 month ago
I will review this PR
@mkuznyetsov sorry about the failing CI tests, that's due to https://github.com/devfile/devworkspace-operator/issues/1242 (not related to your PR). I've opened https://github.com/devfile/devworkspace-operator/pull/1243 to resolve this.
@mkuznyetsov when you get a chance, please rebase your PR onto the main branch so that the Validate PR GH Action will pass btw :)
@mkuznyetsov I think this PR is good to merge :) Before we do so, can you squash your commits with a git rebase --autosquash
please? I also think a705e11
(#1233) could be squashed into 08e12bc
(#1233).
Additionally, the commit description of 08e12bc
(#1233) could maybe be re-worded to something like: feat: label PVCs by storage strategy
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: AObuchow, mkuznyetsov
The full list of commands accepted by this bot can be found here.
The pull request process is described here
Congrats on having your first PR merged to the project @mkuznyetsov :tada: Amazing work :)
What does this PR do?
Add new labels to indicate PVCs that are in use by Devworkspace Operator. This allows to trigger workspace reconcile, that must be triggered upon PVC deletion. and if it's a common PVC that had a name configured by external operator config, only those workspaces that would have the same PVC name should be reconciled
What issues does this PR fix or reference?
https://github.com/devfile/devworkspace-operator/issues/920
Is it tested? How?
Steps to test the new & old behavior with sample DevWorkspaces (DW)
1) install & run a current version of DWO:
https://github.com/devfile/devworkspace-operator/?tab=readme-ov-file#run-controller-locally
2) add some Devworkspaces and a devworkspace:
DW with per-workspace storage
External operator config, that is configured with custom PVC name
Inspect PVC objects, that are created for these repos.
1) build and run a new version of operator from this pull-request: export NAMESPACE="devworkspace-controler" ... make run
1) Create DWs from step TODO:
DW with per-workspace storage
Another external operator config, that is configured with custom PVC name
Observe a label "controller.devfile.io/devworkspace_pvc_type" added to certain kubernetes PVC objects:
claim-devworkspace
PVC will not have this label, since this PVC was created with old DWO. Even new DWOold-custom-pvc-name
PVC will not have this label, butnew-custom-pvc-name
will have itNow start deleting PVCs one after another with
kubectl delete pvc
And see that workspaces are reconciled respectivelly.PR Checklist
/test v8-devworkspace-operator-e2e, v8-che-happy-path
to trigger)v8-devworkspace-operator-e2e
: DevWorkspace e2e testv8-che-happy-path
: Happy path for verification integration with Che