-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix-118: Check UID before deleting PVC #122
base: master
Are you sure you want to change the base?
Conversation
|
No, it checks that the output of sdkGenerate does not modify anything (to guard against API changes). In this case it seems to be that dependencies have changed (go.sum it out of date). We should probably ignore go.sum in this test. |
Do you still want to rebase this? |
@burmanm Thanks for the reminder! Yes I will rebase it this week |
@burmanm I just rebased and pushed again. The conflicts should be resolved now. |
Some unit tests should have been upgraded, but that's not the main problem. There's an issue with the update policy of PersistentVolumeClaim labels in Kubernetes. This code can work if the deployment is new, but if the original deployment was created using an older version of cass-operator, which did not set the UID - we can no longer delete the PVCs. When doing the above scenario, deploying master, deploy storage, update cass-operator, delete cassdc, we end up with an error:
The reason is that StatefulSet PVC labels were not updated, there's no "UID" in any of the existing ones and when you run the delete command, it can't match them. And none of the existing PVCs are deleted even when the StatefulSet itself was:
|
What this PR does:
DatacenterUID
-- the UID of the cassandra datacenterDatacenterUID
to each pvc and check whether labeledDatacenterUID
is the same as the UID of the current datacenter (which has a deletion timestamp) before deleting the pvcWhich issue(s) this PR fixes:
Fixes #118
Checklist
┆Issue is synchronized with this Jiraserver Task by Unito
┆Issue Number: K8SSAND-774
┆Priority: Medium