Update pkg/scheduler/backend/queue/scheduling_queue.go

Co-authored-by: Maciej Skoczeń <87243939+macsko@users.noreply.github.com>
This commit is contained in:
Manthan Parmar
2025-11-18 11:47:00 -05:00
committed by vshkrabkov
parent 2a3a6605ac
commit 41cde37f00

View File

@@ -610,8 +610,11 @@ func (p *PriorityQueue) runPreEnqueuePlugin(ctx context.Context, logger klog.Log
// No need to change GatingPlugin; it's overwritten by the next PreEnqueue plugin if they gate this pod, or it's overwritten with an empty string if all PreEnqueue plugins pass.
return s
}
// Only increment metric and insert if not already incremented for this plugin
if !pInfo.UnschedulablePlugins.Has(pl.Name()) && !pInfo.PendingPlugins.Has(pl.Name()) {
metrics.UnschedulableReason(pl.Name(), pod.Spec.SchedulerName).Inc()
}
pInfo.UnschedulablePlugins.Insert(pl.Name())
metrics.UnschedulableReason(pl.Name(), pod.Spec.SchedulerName).Inc()
pInfo.GatingPlugin = pl.Name()
pInfo.GatingPluginEvents = p.pluginToEventsMap[pInfo.GatingPlugin]
if s.Code() == fwk.Error {