-
Notifications
You must be signed in to change notification settings - Fork 26
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: move the rollout controller to event driven model #1029
base: main
Are you sure you want to change the base?
Conversation
f5fb9bf
to
a9ea18c
Compare
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.
Hi Ryan! I've added some comments, PTAL 🙏
// +kubebuilder:printcolumn:JSONPath=`.status.conditions[?(@.type=="Applied")].status`,name="ResourcesApplied",type=string | ||
// +kubebuilder:printcolumn:JSONPath=`.status.conditions[?(@.type=="Available")].status`,name="ResourceAvailable",priority=1,type=string |
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.
Hi Ryan! This needs a re-gen of the CRD YAML files I think.
@@ -563,6 +562,16 @@ func (r *Reconciler) calculateRealTarget(crp *fleetv1beta1.ClusterResourcePlacem | |||
// A binding with not trackable resources is considered ready if the binding's current spec has been available before | |||
// the ready cutoff time. | |||
func isBindingReady(binding *fleetv1beta1.ClusterResourceBinding, readyTimeCutOff time.Time) (time.Duration, bool) { | |||
// the binding is ready if the diff report has been reported |
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.
Hi Ryan! Aside from the isBindingReady
function we also have a HasBindingFailed
function. Before the update the two functions are mutually exclusive, i.e., if isBindingReady
returns true, HasBindingFailed
would always return false. With the new edit this no longer seems to be stand.
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.
Which brings up a situation that, for a bound binding with the ReportDiff apply strategy, it would be considered as a ready binding (because the DiffReported
condition is true) and a failed binding at the same (because it has a false Applied
conditon and no 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.
it seems that this PR already addressed this exact issue?
@@ -563,6 +562,16 @@ func (r *Reconciler) calculateRealTarget(crp *fleetv1beta1.ClusterResourcePlacem | |||
// A binding with not trackable resources is considered ready if the binding's current spec has been available before | |||
// the ready cutoff time. | |||
func isBindingReady(binding *fleetv1beta1.ClusterResourceBinding, readyTimeCutOff time.Time) (time.Duration, bool) { | |||
// the binding is ready if the diff report has been reported | |||
diffReportCondition := binding.GetCondition(string(fleetv1beta1.ResourceBindingDiffReported)) |
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.
Another thing that I might not have fully thought through is that if we treat DiffReported
bindings to be not-failed, ready bindings it would be subject to rolling update strategy as well, which means it could also get stuck (e.g., member clusters get disconnected). Would this be a very confusing situation for end users (i.e., all the diffs reported would be stale)?
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.
It seems that behavior is exactly what is expected? We are rolling out reportDiff just like any other change. Do you want to blast the reportDiff?
return | ||
} | ||
// these are the conditions we care about | ||
conditionsToMonitor := []string{string(fleetv1beta1.ResourceBindingDiffReported), string(fleetv1beta1.ResourceBindingAvailable)} |
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.
Hi Ryan! All the logic down below would not run if I understand it correctly; if the conditions change the resource versions must have already mismatched; on the contrary, if the resource versions stay the same there would be no status change at all I believe
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.
it was meant to be generation (spec) instead of resource version. The log was right, the code has a typo.
Description of your changes
Fixes #
I have:
make reviewable
to ensure this PR is ready for review.How has this code been tested
Special notes for your reviewer