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

fix(controller): fix waiting for stable rs to be fully scaled before canary scale down #3899

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion rollout/replicaset.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,14 @@ func (c *rolloutContext) reconcileNewReplicaSet() (bool, error) {
}
} else if abortScaleDownDelaySeconds != nil {
// Don't annotate until need to ensure the stable RS is fully scaled
if c.stableRS.Status.AvailableReplicas == *c.rollout.Spec.Replicas {

// We only perform this check if we had something to do with scaling down the stable RS.
// That is, when dynamicStableScale is used. Otherwise, we shouldn't wait for
// it to be the case. Since external influences (cluster autoscalers with their disruptions)
// may prevent the stable rs of becoming fully available for a while, irrelevant to us.

usesDynamicStableScaling := c.rollout.Spec.Strategy.Canary != nil && c.rollout.Spec.Strategy.Canary.DynamicStableScale
if c.stableRS.Status.AvailableReplicas == *c.rollout.Spec.Replicas || !usesDynamicStableScaling {
err = c.addScaleDownDelay(c.newRS, *abortScaleDownDelaySeconds)
if err != nil {
return false, err
Expand Down
Loading