Skip to content

Commit 94f26b3

Browse files
youngLiuHYzoumo
authored andcommitted
fix: workload info status add terminating replicas
1 parent 7303498 commit 94f26b3

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

pkg/controllers/scalerun/executor/batch.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ func (e *batchExecutor) checkScaledReady(info *workload.Info, scaledFrom, scaled
262262
}
263263

264264
if scaledFrom >= scaledTo {
265-
return info.Status.CurrentReplicas <= info.Status.Replicas
265+
return info.Status.CurrentReplicas <= info.Status.Replicas && info.Status.TerminatingReplicas == 0
266266
} else {
267267
return info.Status.AvailableReplicas >= info.Status.Replicas
268268
}

pkg/workload/info.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ type InfoStatus struct {
6363
UpdatedReadyReplicas int32
6464
// UpdatedAvailableReplicas is the number of service available pods targeted by workload that have the updated template spec.
6565
UpdatedAvailableReplicas int32
66+
// TerminatingReplicas is the number of pods which is marked deletion timestamp
67+
TerminatingReplicas int32
6668
}
6769

6870
func NewInfo(cluster string, gvk schema.GroupVersionKind, obj client.Object, status InfoStatus) *Info {

0 commit comments

Comments
 (0)