Report only injected pods after enforcing pod limit

This commit is contained in:
Mahmoud Atwa 2024-10-03 16:27:16 +00:00
parent a886e8026c
commit b185b14ea1
1 changed files with 1 additions and 2 deletions

View File

@ -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)