-
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: changes to rollout controller for eviction #959
base: main
Are you sure you want to change the base?
Conversation
6f4a9ca
to
46c9946
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.
We need to add a few e2e test for the eviction cases
ec98d10
to
f9d5421
Compare
5f5147e
to
a893cce
Compare
Will add another PR to add more E2Es |
8861aff
to
f2f5750
Compare
@@ -607,6 +607,202 @@ var _ = Describe("Test the rollout Controller", func() { | |||
}, 5*time.Minute, interval).Should(BeTrue(), "rollout controller should roll all the bindings to use the latest resource snapshot") | |||
}) | |||
|
|||
It("Rollout should be blocked, then unblocked by eviction - evict unscheduled binding", func() { |
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.
what about the base case that a bound binding is evicted and scheduler creates another binding, make sure we rollout that binding?
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.
Added as an E2E test since it involves the entire flow
90ddef2
to
26b244e
Compare
94e345f
to
21b20a8
Compare
@@ -205,23 +206,23 @@ func TestWaitForResourcesToCleanUp(t *testing.T) { | |||
"test deleting binding block schedule binding on the same cluster": { | |||
allBindings: []*fleetv1beta1.ClusterResourceBinding{ | |||
generateClusterResourceBinding(fleetv1beta1.BindingStateScheduled, "snapshot-1", cluster1), | |||
generateDeletingClusterResourceBinding(cluster1), | |||
setDeletionTimeStampForBinding(generateClusterResourceBinding(fleetv1beta1.BindingStateUnscheduled, "snapshot-1", cluster1)), |
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 add the delete timestamp here? The function it tests doesn't care.
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.
We check deleting binding here https://github.com/Azure/fleet/blob/main/pkg/controllers/rollout/controller.go#L232 and this particular test expects this output https://github.com/Azure/fleet/blob/main/pkg/controllers/rollout/controller.go#L262
}, | ||
}, | ||
wantTobeUpdatedBindings: []int{2}, // specified MaxSurge helps us pick one scheduled binding to rollout. we don't have any ready binding so we don't remove any binding. |
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.
In theory, we pick one from 2 or 3. is it guaranteed to pick 2?
Strategy: fleetv1beta1.RolloutStrategy{ | ||
Type: fleetv1beta1.RollingUpdateRolloutStrategyType, | ||
RollingUpdate: &fleetv1beta1.RollingUpdateConfig{ | ||
wantTobeUpdatedBindings: []int{1}, // specified MaxUnavailable helps us remove unscheduled binding, deleting unscheduled binding even though ready is a canBeUnavailable binding. |
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.
wantTobeUpdatedBindings: []int{1}, // specified MaxUnavailable helps us remove unscheduled binding, deleting unscheduled binding even though ready is a canBeUnavailable binding. | |
wantTobeUpdatedBindings: []int{1}, // specified MaxUnavailable helps us remove unscheduled binding, deleting unscheduled binding even though it is a canBeUnavailable binding. |
Type: fleetv1beta1.RollingUpdateRolloutStrategyType, | ||
RollingUpdate: &fleetv1beta1.RollingUpdateConfig{ | ||
wantTobeUpdatedBindings: []int{1}, // specified MaxUnavailable helps us remove unscheduled binding, deleting unscheduled binding even though ready is a canBeUnavailable binding. | ||
wantStaleUnselectedBindings: []int{2, 3}, |
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.
add a comment here too? something like we can't pick them because the max Surge is 0?
@@ -397,20 +398,27 @@ func (r *Reconciler) pickBindingsToRoll(ctx context.Context, allBindings []*flee | |||
} else { | |||
canBeReadyBindings = append(canBeReadyBindings, binding) |
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.
if the bindingReady then it can't be failed, so shouldn't this be in line 388 block?
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