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

Progressive status helper and in-progress status checker #422

Merged
merged 2 commits into from
Jan 9, 2023

Conversation

darkowlzz
Copy link
Contributor

This change introduces a helper and a checker for progressive status of objects that are undergoing reconciliation. Progressive status are the status conditions that appear on an object in the middle of a reconciliation, also referred as mid-reconciliation status in this change. Reconciling and Ready are primarily involved in progressive status to indicate that an object is undergoing reconciliation.

  • When an object is reconciled for the first time, progressive status of Reconciling=True and Ready=Unknown are expected on the object.
  • On subsequent reconciliation with Ready=True set by a previous reconciliation, the Reconciling=True with Ready=True indicates that the reconciler is reconciling an object but hasn't detected any drift to act upon.
  • Ready=Unknown indicates that there may be some drift for which the reconciler is performing some action.

ProgressiveStatus helper

For working with the above scenarios of progressive status, a helper ProgressiveStatus(drift, obj, reason, msg, msgArgs...) is introduced. It helps mark an object Reconciling=True and also Ready=Unknown with the same reason and message if a drift is detected. If no drift is detected, only Reconciling=True is set.

In-progress status checker

The progressive status conditions of an object are observed to be orthogonal to the final status of the object after a full reconciliation that's computed by various status summarization techniques. During a reconciliation, there's not enough information to perform full summarization of the status conditions. The partial information is sufficient to only report the current status of reconciliation in the form of progressive status. This results in differences in the considerations of status conditions check on an object. Due to this, the WARN and FAIL checks of the status checker have been updated to indicate if they apply to mid-reconciliation status or not. And a new check is added that's specific to mid-reconciliation status.
Due to the different sets of checks, a new in-progress status checker is introduced, which can be created with NewInProgressChecker(). With this, we have two separate status checkers which can be used to check the progressive status and fully reconciled status of an object.

Fixes #380

@darkowlzz darkowlzz added the area/runtime Controller runtime related issues and pull requests label Dec 5, 2022
@darkowlzz darkowlzz force-pushed the intermediate-conditions-summary branch from fa89d27 to 3f943b7 Compare December 5, 2022 18:10
Copy link
Member

@stefanprodan stefanprodan left a comment

Choose a reason for hiding this comment

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

LGTM

Thanks @darkowlzz 🏅

Copy link
Member

@pjbgf pjbgf left a comment

Choose a reason for hiding this comment

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

LGTM

Great stuff @darkowlzz! 🙇

@darkowlzz darkowlzz force-pushed the intermediate-conditions-summary branch from 3f943b7 to c007d73 Compare December 6, 2022 18:52
@darkowlzz darkowlzz force-pushed the intermediate-conditions-summary branch 2 times, most recently from 0e24dd3 to 4aa0603 Compare January 9, 2023 12:42
Copy link
Member

@hiddeco hiddeco left a comment

Choose a reason for hiding this comment

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

Other than the two minor commented nits, this looks good to me.

Add a progressive status helper for setting the Reconciling and Ready
conditions in the middle of reconciliation with consideration for
drift detection.

Signed-off-by: Sunny <darkowlzz@protonmail.com>
InProgressChecker is a variant of the status conditions checker with a
different set of checks that are applicable to the objects in the middle
of on-going reconciliation, with intermediate conditions.

Delete invalid check FAIL0010.
Add FAIL0011 for mid-reconciliation scenario.

Signed-off-by: Sunny <darkowlzz@protonmail.com>
@darkowlzz darkowlzz force-pushed the intermediate-conditions-summary branch from 4aa0603 to 7962d2a Compare January 9, 2023 14:19
@darkowlzz darkowlzz merged commit ad2ee3c into main Jan 9, 2023
@darkowlzz darkowlzz deleted the intermediate-conditions-summary branch January 9, 2023 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/runtime Controller runtime related issues and pull requests
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

runtime/conditions/check: Remove ObservedGeneration check
4 participants