From 4aee7f6b58811ae3d80cfa33ec91e148099dcf16 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 cecc10d2cf..26ed541afe 100644 --- a/pkg/controller/cloneset/cloneset_status.go +++ b/pkg/controller/cloneset/cloneset_status.go @@ -100,8 +100,8 @@ func (r *realStatusUpdater) calculateStatus(cs *appsv1alpha1.CloneSet, newStatus newStatus.UpdatedReadyReplicas++ } } - // 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 }