-
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
Synchronously emit template events #56
Synchronously emit template events #56
Conversation
This should make it slightly more re-usable in other controllers. In particular this allows the `instance` to be `nil`, which might be the case if the template was not created. Signed-off-by: Justin Kulikauskas <[email protected]>
This might be slightly more performant, and other things can use this clientset. Signed-off-by: Justin Kulikauskas <[email protected]>
Previously, the controller-runtime event recorder was used for these events. Other policy controllers have moved away from that, for various reasons. In this case, if a policy went from pending to noncompliant and back to pending, the "old" pending event would be re-used by the event recorder, and only the `lastTimestamp` would be updated. In this case, if a policy controller emitted a compliance event within the same second as the Pending event, the status-sync would see it as a tie, and use the hex-encoded nanoseconds in the event name. But the event name was not updated from the original instance when the policy was pending, so the events would be ordered incorrectly. Most error cases from this synchronous sending can be ignored because they are already error cases that would be requeued. Refs: - https://issues.redhat.com/browse/ACM-4699 Signed-off-by: Justin Kulikauskas <[email protected]>
does this pr need squash? |
Succeeding 30 times in a row on the targeted framework tests: (last 3 commits). |
I can squash it if you want, but I felt like splitting the changes into these commits made sense. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: 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:
Approvers can indicate their approval by writing |
Main commit:
Previously, the controller-runtime event recorder was used for these events. Other policy controllers have moved away from that, for various reasons. In this case, if a policy went from pending to noncompliant and back to pending, the "old" pending event would be re-used by the event recorder, and only the
lastTimestamp
would be updated. In this case, if a policy controller emitted a compliance event within the same second as the Pending event, the status-sync would see it as a tie, and use the hex-encoded nanoseconds in the event name. But the event name was not updated from the original instance when the policy was pending, so the events would be ordered incorrectly.Most error cases from this synchronous sending can be ignored because they are already error cases that would be requeued.
Refs: