From fe0febbf1fbde0e86cebdf50c686b580d08ac8ce Mon Sep 17 00:00:00 2001 From: zongqingli Date: Wed, 9 Aug 2023 16:47:27 +0800 Subject: [PATCH] fix federated-hpa plain metric calc Signed-off-by: zach593 --- pkg/controllers/federatedhpa/replica_calculator.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/controllers/federatedhpa/replica_calculator.go b/pkg/controllers/federatedhpa/replica_calculator.go index b0af74fdedf8..020c6bd712ef 100644 --- a/pkg/controllers/federatedhpa/replica_calculator.go +++ b/pkg/controllers/federatedhpa/replica_calculator.go @@ -189,7 +189,7 @@ func (c *ReplicaCalculator) calcPlainMetricReplicas(metrics metricsclient.PodMet for podName := range missingPods { metrics[podName] = metricsclient.PodMetric{Value: targetUsage} } - } else { + } else if usageRatio > 1.0 { // on a scale-up, treat missing pods as using 0% of the resource request for podName := range missingPods { metrics[podName] = metricsclient.PodMetric{Value: 0}