From b185b14ea1a3a547b057f281c27da7b5c3ae6438 Mon Sep 17 00:00:00 2001 From: Mahmoud Atwa Date: Thu, 3 Oct 2024 16:27:16 +0000 Subject: [PATCH] Report only injected pods after enforcing pod limit --- .../podinjection/enforce_injected_pods_limit_processor.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cluster-autoscaler/processors/podinjection/enforce_injected_pods_limit_processor.go b/cluster-autoscaler/processors/podinjection/enforce_injected_pods_limit_processor.go index 9cd6e1ad5704..5f8fac6fbb5c 100644 --- a/cluster-autoscaler/processors/podinjection/enforce_injected_pods_limit_processor.go +++ b/cluster-autoscaler/processors/podinjection/enforce_injected_pods_limit_processor.go @@ -23,7 +23,6 @@ import ( ) const ( - // InjectedMetricsLabel is the label for unschedulable pods metric for injected pods. InjectedMetricsLabel = "injected" // SkippedInjectionMetricsLabel is the label for unschedulable pods metric for pods that was not injected due to limit. @@ -52,11 +51,11 @@ func (p *EnforceInjectedPodsLimitProcessor) Process(ctx *context.AutoscalingCont for _, pod := range unschedulablePods { if IsFake(pod) { - injectedFakePodsCount += 1 if removedFakePodsCount < numberOfFakePodsToRemove { removedFakePodsCount += 1 continue } + injectedFakePodsCount += 1 } unschedulablePodsAfterProcessing = append(unschedulablePodsAfterProcessing, pod)