Filter out status updates from the reconcile loop#747
Filter out status updates from the reconcile loop#747metal3-io-bot merged 1 commit intometal3-io:masterfrom
Conversation
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: andfasano, dhellmann The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/test-integration |
zaneb
left a comment
There was a problem hiding this comment.
Great that you found that doc! I've been wondering about how this was supposed to work since forever.
In BMO I think we are pretty good at always returning Requeue=true when we want to requeue, instead of relying on the status write to trigger it (like some other controllers, e.g. CAPBM, do), so this ought to work. One comment inline.
d8d19aa to
9b3dbf7
Compare
|
/test-integration |
|
I checked all of the places that Reconcile() returns, and confirmed that the only ones where we're not explicitly requesting a requeue are where we really don't want it. |
Everytime the BMH status is saved the
LastUpdatedfield is updated with the current time, and a new update is generated if the marshalled string results different from the previous version (up to the seconds), producing more reconcile loops than needed.This PR filters out all the updates on the Status by ignoring all those ones that do not increase the Generation field (except for the finalizers and annotations) [1]
[1] https://www.openshift.com/blog/kubernetes-operators-best-practices