hpa: cleanup currentReplicas code

Signed-off-by: huiwq1990 <huiwq1990@163.com>
This commit is contained in:
huiwq1990 2023-05-22 20:37:00 +08:00
parent 6356023cb4
commit 048938f1d8

View File

@ -819,7 +819,7 @@ func (a *HorizontalController) reconcileAutoscaler(ctx context.Context, hpaShare
rescale := true
logger := klog.FromContext(ctx)
if scale.Spec.Replicas == 0 && minReplicas != 0 {
if currentReplicas == 0 && minReplicas != 0 {
// Autoscaling is disabled for this resource
desiredReplicas = 0
rescale = false