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

Add flag to disable PlacementRule watches #232

Conversation

JustinKuli
Copy link
Member

@JustinKuli JustinKuli commented Jul 2, 2024

Some deployments will not want to install the PlacementRule CRD, since it is an older API which may eventually be removed. This adds an argument to the propagator which will disable all watches on PlacementRules, allowing the controllers to run in those environments.

In addition, if the flag is not set, the controller will check for the PlacementRule CRD on the cluster, and if not found, disable those watches (which would otherwise fail and prevent the controller from working).

Refs:

Some deployments will not want to install the PlacementRule CRD, since
it is an older API which may eventually be removed. This adds an
argument to the propagator which will disable all watches on
PlacementRules, allowing the controllers to run in those environments.

In addition, if the flag is not set, the controller will check for the
PlacementRule CRD on the cluster, and if not found, disable those
watches (which would otherwise fail and prevent the controller from
working).

Refs:
 - https://issues.redhat.com/browse/ACM-2609

Signed-off-by: Justin Kulikauskas <[email protected]>
@JustinKuli JustinKuli force-pushed the 2609-optional-placement-rule branch from 044cd6d to 8a51190 Compare July 9, 2024 17:08
@JustinKuli JustinKuli marked this pull request as ready for review July 9, 2024 17:50
@@ -11,7 +11,7 @@ import (
"open-cluster-management.io/governance-policy-propagator/test/utils"
)

var _ = Describe("Test unexpect policy handling", func() {
var _ = Describe("Test unexpect policy handling", Label("non-placement-rule"), func() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Everything is good! but Why is this test in non-placementRule?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is the one test I found that didn't use PlacementRule. In the future, I'm hoping we have others (maybe we already do, I didn't look super hard).

For this PR, I just needed at least one test for that suite to make sure that the controller didn't crash when the PlacementRule CRD was no longer present.

Copy link

openshift-ci bot commented Jul 17, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JustinKuli, 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

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.

3 participants