Skip to content

Commit

Permalink
fix: calculate scale down count. (#1047)
Browse files Browse the repository at this point in the history
Signed-off-by: zhouchencheng <[email protected]>
  • Loading branch information
zcc35357949 authored Apr 7, 2021
1 parent a0c6ec8 commit f594c74
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion utils/replicaset/canary.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f594c74

Please sign in to comment.