-
Notifications
You must be signed in to change notification settings - Fork 19
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
[release-2.7] 🤖 Sync from open-cluster-management-io/config-policy-controller: #96 #400
[release-2.7] 🤖 Sync from open-cluster-management-io/config-policy-controller: #96 #400
Conversation
Previously, when the controller is removed, it could leave a mess behind in the form of ConfigurationPolicy objects with finalizers on them. That would also result in the CRD being stuck. Now, the controller will put a finalizer on its own deployment when at least one ConfigurationPolicy has a finalizer. Also, while the deployment is being deleted, the finalizers on ConfigurationPolicies will be removed immediately, in the same way they would be when the CRD was being deleted. Note: in this implementation, related objects might *never* be pruned when the controller is removed. Since the controller deployment is in a different namespace than the ConfigutaionPolicies it watches, the controller's cache cannot be limited to a single namespace the way it was before. Instead, this uses additional cache selectors to limit watches on ConfigurationPolicies and Deployments to the relevant namespaces. Refs: - https://issues.redhat.com/browse/ACM-2923 Signed-off-by: Justin Kulikauskas <jkulikau@redhat.com> (cherry picked from commit e60e939)
Kudos, SonarCloud Quality Gate passed! |
needDeploymentFinalizer := false | ||
|
||
for _, plc := range policiesList.Items { | ||
if objHasFinalizer(&plc, pruneObjectFinalizer) { |
Check warning
Code scanning / SonarCloud
<!--SONAR_ISSUE_KEY:AYXRXj2WWApvY56FffA--->Implicit memory aliasing in for loop. <p>See more on <a href="https://sonarcloud.io/project/issues?id=open-cluster-management_config-policy-controller&issues=AYXRXj2WWApvY56FffA-&open=AYXRXj2WWApvY56FffA-&pullRequest=400">SonarCloud</a></p>
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.
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: JustinKuli, openshift-cherrypick-robot 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 |
This is an automated cherry-pick of #397
/assign JustinKuli