Skip to content
This repository has been archived by the owner on Jun 26, 2023. It is now read-only.

HNC: ensure there are no finalizers on any CRD if the CRD is being deleted #824

Closed
adrianludwin opened this issue Jun 25, 2020 · 2 comments · Fixed by #833
Closed

HNC: ensure there are no finalizers on any CRD if the CRD is being deleted #824

adrianludwin opened this issue Jun 25, 2020 · 2 comments · Fixed by #833
Milestone

Comments

@adrianludwin
Copy link
Contributor

adrianludwin commented Jun 25, 2020

I noticed that we had a hasSubnamespace finalizer on an HC as we were trying to delete the CRD to uninstall HNC. This prevents uninstallation needlessly. We should remove all finalizers if the CRD is being deleted.

@adrianludwin
Copy link
Contributor Author

adrianludwin commented Jun 25, 2020

Note that this is the opposite of #718. While that bug's about deleting everything except the CRDs, if you do want to delete the CRDs, you need to delete them first so the manager can remove all the necessary finalizers.

@adrianludwin
Copy link
Contributor Author

Looks like we're trying to remove the finalizer but once we realize the HC is being deleted, we stop updating it. This is clearly wrong, we need to do something smarter to uninstall.

In the meantime, the workaround is to delete the anchor CRD first.

adrianludwin added a commit to adrianludwin/multi-tenancy that referenced this issue Jul 1, 2020
See kubernetes-retired#824. When the CRDs are being deleted, we need to continue
reconciling the CRs until they're gone in order to ensure that any
finalizers on the CRs are removed.

Tested: new test script usually fails without this fix, but reliably
passes with it. Observed the new log messages working as expected while
running the script.
adrianludwin added a commit to adrianludwin/multi-tenancy that referenced this issue Jul 1, 2020
See kubernetes-retired#824. When the CRDs are being deleted, we need to continue
reconciling the CRs until they're gone in order to ensure that any
finalizers on the CRs are removed.

Tested: new test script usually fails without this fix, but reliably
passes with it. Observed the new log messages working as expected while
running the script.
adrianludwin added a commit to adrianludwin/multi-tenancy that referenced this issue Jul 2, 2020
See kubernetes-retired#824. When the CRDs are being deleted, we need to continue
reconciling the CRs until they're gone in order to ensure that any
finalizers on the CRs are removed.

Tested: new test script usually fails without this fix, but reliably
passes with it. Observed the new log messages working as expected while
running the script.
adrianludwin added a commit to adrianludwin/multi-tenancy that referenced this issue Jul 2, 2020
See kubernetes-retired#824. When the CRDs are being deleted, we need to continue
reconciling the CRs until they're gone in order to ensure that any
finalizers on the CRs are removed.

Tested: new test script usually fails without this fix, but reliably
passes with it. Observed the new log messages working as expected while
running the script. For subnamespace anchors, tried removing the
CRD-checking code entirely and verified that
hack/test-delete-anchor-crd.sh failed, and then replaced it with the
current code (the shared isDeletingCRD function) and verified that it
passed again.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant