enable ClusterAccessReconciler's Reconcile method to be called during deletion #197
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
When working with the ClusterAccess library and trying to delete resource, one should theoretically call
Reconcileat the beginning of the deletion logic, ensuring the access to the cluster exists so resources on the cluster can be deleted. After that is done, one should callReconcileDeleteto delete the resources for the cluster access itself.This was not possible so far, because when walking through the deletion logic multiple times (because it waits for resources to be removed), the call to
Reconcilewould re-create resources that had already been deleted byReconcileDelete, causing the deletion to be stuck in an endless loop.This PR changes the clusteraccess library's logic in two ways:
AccessRequestmethod.ReconcileDeleteis first called and by removing the request from the internal storage again whenReconcileDeletereturns without a RequeueAfter value and without an error. As long as a request is part of the internal storage, callingReconcilefor this request will not create any new resources. This makes it possible to callReconcileduring the controller's deletion logic without having to worry about it re-creating already deleted resources.Which issue(s) this PR fixes:
Fixes #192
Special notes for your reviewer:
Release note: