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

Reset the complianceState when Pending #54

Conversation

JustinKuli
Copy link
Member

The situation this is meant to fix is not fully understood. But in case a policy template that was previously pending somehow has some status that has not yet made its way into the Policy's status, this will reset it, so that the policy controller knows to send a new compliance event.

Refs:

The situation this is meant to fix is not fully understood. But in case
a policy template that was previously pending somehow has some status
that has not yet made its way into the Policy's status, this will reset
it, so that the policy controller knows to send a new compliance event.

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

Signed-off-by: Justin Kulikauskas <jkulikau@redhat.com>
Copy link
Member

@dhaiducek dhaiducek left a comment

Choose a reason for hiding this comment

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

/hold for other reviews

This is an odd corner of code, but this does make sense to resolve the E2E test. I guess resetting the compliance forces the policy controller to send another event to verify its compliance?

@openshift-ci
Copy link

openshift-ci bot commented Apr 13, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dhaiducek, JustinKuli, yiraeChristineKim

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 [JustinKuli,dhaiducek,yiraeChristineKim]

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

@JustinKuli
Copy link
Member Author

I guess resetting the compliance forces the policy controller to send another event to verify its compliance?

Yes exactly. We already did this for some cases involving template-errors. I think it could be the case whenever the latest status was supplied by the template-sync controller, instead of the policy-controller. So far I think (hope) that the only situations for that are when it goes into Pending, and when it has a template-error.

The policy-controller doesn't really know about the Policy (how confusing is that? 😄) so it doesn't see those statuses. So it assumes the last status is the last one it sent, and it doesn't need to send another.

@dhaiducek
Copy link
Member

/unhold

Matt's out until Monday and that policy ordering test is getting pretty annoying. I say let's give this a shot.

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.

4 participants