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

🤖 Sync from open-cluster-management-io/config-policy-controller: #96 #397

Merged
merged 1 commit into from
Jan 20, 2023

Conversation

magic-mirror-bot[bot]
Copy link

@magic-mirror-bot magic-mirror-bot bot commented Jan 20, 2023

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)
@sonarcloud
Copy link

sonarcloud bot commented Jan 20, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 1 Vulnerability
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

52.6% 52.6% Coverage
0.0% 0.0% Duplication

needDeploymentFinalizer := false

for _, plc := range policiesList.Items {
if objHasFinalizer(&plc, pruneObjectFinalizer) {

Check warning

Code scanning / SonarCloud

<!--SONAR_ISSUE_KEY:AYXQ0_DzteWHWF4GPkzC-->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=AYXQ0_DzteWHWF4GPkzC&open=AYXQ0_DzteWHWF4GPkzC&pullRequest=397">SonarCloud</a></p>

<!--SONAR_ISSUE_KEY:AYXQ0_DzteWHWF4GPkzC-->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=AYXQ0_DzteWHWF4GPkzC&open=AYXQ0_DzteWHWF4GPkzC&pullRequest=397">SonarCloud</a></p>
@mprahl
Copy link
Contributor

mprahl commented Jan 20, 2023

@JustinKuli , the gosec error is fixed here (needs a review):
open-cluster-management-io/config-policy-controller#97

The flakiness of the Framework test should be fixed by this:
stolostron/governance-policy-framework#542

Copy link
Contributor

@mprahl mprahl left a comment

Choose a reason for hiding this comment

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

Let's merge this one and then let the Magic Mirror sync the Gosec fix:
open-cluster-management-io/config-policy-controller#97

@openshift-ci
Copy link

openshift-ci bot commented Jan 20, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: magic-mirror-bot[bot], mprahl

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit 5ea3546 into main Jan 20, 2023
@openshift-merge-robot openshift-merge-robot deleted the magic-mirror-main-1674242143770 branch January 20, 2023 21:38
@JustinKuli
Copy link
Contributor

/cherrypick release-2.7

@openshift-cherrypick-robot

@JustinKuli: new pull request created: #400

In response to this:

/cherrypick release-2.7

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

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.

😿 Failed to sync the upstream PRs: #96
4 participants