Skip to content

Commit d3275e0

Browse files
author
cskh
authored
fix(canary): scale up and down old replicas (argoproj#1824)
Signed-off-by: Hui Kang <[email protected]>
1 parent 56a94f4 commit d3275e0

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

rollout/canary.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,6 @@ func (c *rolloutContext) scaleDownOldReplicaSetsForCanary(oldRSs []*appsv1.Repli
174174
}
175175

176176
annotationedRSs := int32(0)
177-
rolloutReplicas := defaults.GetReplicasOrDefault(c.rollout.Spec.Replicas)
178177
for _, targetRS := range oldRSs {
179178
if replicasetutil.IsStillReferenced(c.rollout.Status, targetRS) {
180179
// We should technically never get here because we shouldn't be passing a replicaset list
@@ -204,8 +203,8 @@ func (c *rolloutContext) scaleDownOldReplicaSetsForCanary(oldRSs []*appsv1.Repli
204203
// 1. if we are using dynamic scaling, then this should be scaled down to 0 now
205204
desiredReplicaCount = 0
206205
} else {
207-
// 2. otherwise, honor scaledown delay second
208-
annotationedRSs, desiredReplicaCount, err = c.scaleDownDelayHelper(targetRS, annotationedRSs, rolloutReplicas)
206+
// 2. otherwise, honor scaledown delay second and keep replicas of the current step
207+
annotationedRSs, desiredReplicaCount, err = c.scaleDownDelayHelper(targetRS, annotationedRSs, *targetRS.Spec.Replicas)
209208
if err != nil {
210209
return totalScaledDown, err
211210
}

0 commit comments

Comments
 (0)