-
Notifications
You must be signed in to change notification settings - Fork 54
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
Handle finalizer removal #471
Handle finalizer removal #471
Conversation
Signed-off-by: John Collier <[email protected]>
Signed-off-by: John Collier <[email protected]>
Signed-off-by: John Collier <[email protected]>
Quality Gate passedIssues Measures |
@@ -86,6 +90,25 @@ func (r *ApplicationReconciler) Reconcile(ctx context.Context, req ctrl.Request) | |||
return reconcile.Result{}, err | |||
} | |||
|
|||
// If the resource still has the finalizer attached to it, just remove it so deletion doesn't get blocked | |||
if containsString(application.GetFinalizers(), appFinalizerName) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had copied the code back to how we initially did it, which didn't use string.Contains.
I can't remember why we didn't use it, but would prefer we leave the original code as-is
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: johnmcollier, yangcao77 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What does this PR do?:
Updates the Application and Component controllers to add back the finalizer removal code. Upon each reconcile of a resource, the controllers will check if the resource still has the finalizer present, and if so, removes it before completing reconciliation. This will also ensure that no resources have finalizers left when HAS is deprecated.
Which issue(s)/story(ies) does this PR fixes:
N/A, but relates to https://issues.redhat.com/browse/DEVHAS-648
PR acceptance criteria:
Unit/Functional tests
Documentation
Client Impact
How to test changes / Special notes to the reviewer: