From 4693f8160528f2c17f9016be7746e409d3d7a9eb Mon Sep 17 00:00:00 2001 From: sh Date: Mon, 1 Apr 2024 14:01:39 +0800 Subject: [PATCH] fix: cloneset revision update (#1549) Signed-off-by: suhe --- pkg/controller/cloneset/cloneset_status.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/controller/cloneset/cloneset_status.go b/pkg/controller/cloneset/cloneset_status.go index e2823614cc..5b9d53794b 100644 --- a/pkg/controller/cloneset/cloneset_status.go +++ b/pkg/controller/cloneset/cloneset_status.go @@ -104,8 +104,8 @@ func (r *realStatusUpdater) calculateStatus(cs *appsv1alpha1.CloneSet, newStatus newStatus.UpdatedAvailableReplicas++ } } - // Consider the update revision as stable if revisions of all pods are consistent to it, no need to wait all of them ready - if newStatus.UpdatedReplicas == newStatus.Replicas { + // Consider the update revision as stable if revisions of all pods are consistent to it and have the expected number of replicas, no need to wait all of them ready + if newStatus.UpdatedReplicas == newStatus.Replicas && newStatus.Replicas == *cs.Spec.Replicas { newStatus.CurrentRevision = newStatus.UpdateRevision }