diff --git a/pkg/scheduler/framework/types.go b/pkg/scheduler/framework/types.go index 687143e520a..9b4c0b874c4 100644 --- a/pkg/scheduler/framework/types.go +++ b/pkg/scheduler/framework/types.go @@ -208,7 +208,7 @@ type QueuedPodInfo struct { // latency for a pod. InitialAttemptTimestamp *time.Time // UnschedulablePlugins records the plugin names that the Pod failed with Unschedulable or UnschedulableAndUnresolvable status. - // It's registered only when the Pod is rejected in PreFilter, Filter, Reserve, or Permit (WaitOnPermit). + // It's registered only when the Pod is rejected in PreFilter, Filter, Reserve, PreBind or Permit (WaitOnPermit). UnschedulablePlugins sets.Set[string] // PendingPlugins records the plugin names that the Pod failed with Pending status. PendingPlugins sets.Set[string] diff --git a/pkg/scheduler/schedule_one.go b/pkg/scheduler/schedule_one.go index 33f68468d2c..9324a7f1e12 100644 --- a/pkg/scheduler/schedule_one.go +++ b/pkg/scheduler/schedule_one.go @@ -292,6 +292,17 @@ func (sched *Scheduler) bindingCycle( // Run "prebind" plugins. if status := fwk.RunPreBindPlugins(ctx, state, assumedPod, scheduleResult.SuggestedHost); !status.IsSuccess() { + if status.IsRejected() { + fitErr := &framework.FitError{ + NumAllNodes: 1, + Pod: assumedPodInfo.Pod, + Diagnosis: framework.Diagnosis{ + NodeToStatusMap: framework.NodeToStatusMap{scheduleResult.SuggestedHost: status}, + UnschedulablePlugins: sets.New(status.Plugin()), + }, + } + return framework.NewStatus(status.Code()).WithError(fitErr) + } return status }