-
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: drift detection + takeover (full draft) #1001
Changes from all commits
9632a1a
3ba4355
e3807c8
cbbfe5d
4d1d281
884c3c9
99f3860
0418fd6
8760d2d
36c65d6
346f1c6
41532cb
aaf608f
378d028
0f2062e
b9d06bc
1a1a87b
a3bea65
e0a0ffe
2ca546c
902c789
83e2e15
4cdf5f7
41c36d0
1d4619e
761cb02
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -123,6 +123,16 @@ func isBindingStatusUpdated(oldBinding, newBinding *fleetv1beta1.ClusterResource | |
klog.V(2).InfoS("The binding failed placement has changed, need to update the corresponding CRP", "oldBinding", klog.KObj(oldBinding), "newBinding", klog.KObj(newBinding)) | ||
return true | ||
} | ||
|
||
if !utils.IsDriftedResourcePlacementEqual(oldBinding.Status.DriftedPlacements, newBinding.Status.DriftedPlacements) { | ||
klog.V(2).InfoS("The binding drifted placement has changed, need to update the corresponding CRP", "oldBinding", klog.KObj(oldBinding), "newBinding", klog.KObj(newBinding)) | ||
return true | ||
} | ||
|
||
if !utils.IsDiffedResourcePlacementEqual(oldBinding.Status.DiffedPlacements, newBinding.Status.DiffedPlacements) { | ||
klog.V(2).InfoS("The binding diffed placement has changed, need to update the corresponding CRP", "oldBinding", klog.KObj(oldBinding), "newBinding", klog.KObj(newBinding)) | ||
return true | ||
} | ||
Comment on lines
+126
to
+135
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is there any e2e cover this case? |
||
klog.V(5).InfoS("The binding status has not changed, no need to update the corresponding CRP", "oldBinding", klog.KObj(oldBinding), "newBinding", klog.KObj(newBinding)) | ||
return false | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -262,9 +262,10 @@ func (r *Reconciler) setResourcePlacementStatusPerCluster(crp *fleetv1beta1.Clus | |
if bindingCond.Status == metav1.ConditionFalse { | ||
status.FailedPlacements = binding.Status.FailedPlacements | ||
status.DiffedPlacements = binding.Status.DiffedPlacements | ||
status.DriftedPlacements = binding.Status.DriftedPlacements | ||
} | ||
} | ||
// Drifts are reported regardless of the status of the Applied condition. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is there any e2e cover this case? |
||
status.DriftedPlacements = binding.Status.DriftedPlacements | ||
cond := metav1.Condition{ | ||
Type: string(i.ResourcePlacementConditionType()), | ||
Status: bindingCond.Status, | ||
|
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.
where do those magic number come from?