-
Notifications
You must be signed in to change notification settings - Fork 27
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
feat: tweak the condition behaviors in the new work applier #1039
base: main
Are you sure you want to change the base?
Conversation
// Some exported reasons. Currently only the untrackable reason is being actively used. | ||
WorkNotTrackableReason = string(ManifestProcessingAvailabilityResultTypeNotTrackable) | ||
// Some exported reasons for Work object conditions. Currently only the untrackable reason is being actively used. | ||
WorkNotAllManfestsTrackableReason = "SomeManifestsAreNotAvailabilityTrackable" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WorkNotAllManfestsTrackableReason = "SomeManifestsAreNotAvailabilityTrackable" | |
WorkNotAllManifestsTrackableReason = "SomeManifestsAreNotAvailabilityTrackable" |
if isManifestObjectDiffReported(bundle.reportDiffResTyp) { | ||
diffReportedObjectsCount++ | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why Is there no UT test change related to this change that count "both diff and noDiff as reported"
} | ||
|
||
if work.Status.Conditions == nil { | ||
work.Status.Conditions = []metav1.Condition{} | ||
} | ||
setWorkAppliedCondition(work, manifestCount, appliedManifestsCount) | ||
setWorkAvailableCondition(work, manifestCount, availableAppliedObjectsCount, untrackableAppliedObjectsCount) | ||
setWorkDiffReportedCondition(work, manifestCount, diffedObjectsCount) | ||
setWorkAvailableCondition(work, manifestCount, appliedManifestsCount, availableAppliedObjectsCount, untrackableAppliedObjectsCount) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: what if the appliedCondition (say false) does not agree with appliedManifestsCount (say == manifestCount)? I think it's slightly better to use the output of the setWorkAppliedCondition to determine the appliedCondition than using "appliedManifestsCount" as they are two source of truth
if appliedCond != nil { | ||
meta.SetStatusCondition(&manifestCond.Conditions, *appliedCond) | ||
} else { | ||
// As the conditions are ported back; removal must be performed if the DiffReported | ||
// condition is not set. | ||
meta.RemoveStatusCondition(&manifestCond.Conditions, fleetv1beta1.WorkConditionTypeApplied) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see any test changes that is related to most of the changes in this file
case appliedManifestCount != manifestCount: | ||
// Not all manifests have been applied; skip updating the Available condition. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here, no test change needed?
Description of your changes
This PR tweaks how the new work applier sets conditions for the Work objects and their manifests.
I have:
make reviewable
to ensure this PR is ready for review.How has this code been tested
Special notes for your reviewer