Skip to content
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

Merged
merged 3 commits into from
May 9, 2024

Conversation

johnmcollier
Copy link
Member

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:

@openshift-ci openshift-ci bot requested review from maysunfaisal and yangcao77 May 9, 2024 14:38
@openshift-ci openshift-ci bot added the approved label May 9, 2024
Signed-off-by: John Collier <[email protected]>
Copy link

sonarqubecloud bot commented May 9, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@@ -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) {
Copy link
Member Author

@johnmcollier johnmcollier May 9, 2024

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

Copy link
Contributor

@yangcao77 yangcao77 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link

openshift-ci bot commented May 9, 2024

[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:
  • OWNERS [johnmcollier,yangcao77]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@johnmcollier johnmcollier merged commit 55667ac into redhat-appstudio:main May 9, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants