From f594c7484f38a28565a0e8974fab47d567f84525 Mon Sep 17 00:00:00 2001 From: zcc35357949 Date: Thu, 8 Apr 2021 07:57:41 +0800 Subject: [PATCH] fix: calculate scale down count. (#1047) Signed-off-by: zhouchencheng --- utils/replicaset/canary.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/replicaset/canary.go b/utils/replicaset/canary.go index fb107eb15f..701c842a26 100644 --- a/utils/replicaset/canary.go +++ b/utils/replicaset/canary.go @@ -194,7 +194,7 @@ func CalculateReplicaCountsForCanary(rollout *v1alpha1.Rollout, newRS *appsv1.Re if *newRS.Spec.Replicas-scaleDownCount < desiredNewRSReplicaCount { newRSReplicaCount = desiredNewRSReplicaCount // Calculating how many replicas were used to scale down to the desired count - scaleDownCount = scaleDownCount - (desiredNewRSReplicaCount - *newRS.Spec.Replicas) + scaleDownCount = scaleDownCount - (*newRS.Spec.Replicas - desiredNewRSReplicaCount) } else { // The controller is using every replica it can to get closer to desired state. newRSReplicaCount = *newRS.Spec.Replicas - scaleDownCount