Skip to content

Commit 96827ea

Browse files
authored
Merge pull request kubernetes#125360 from pohly/dra-scheduler-prebind-pending
scheduler: allow PreBind to return "Pending" and "Unschedulable"
2 parents 9d8edca + c339eaf commit 96827ea

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

pkg/scheduler/framework/types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ type QueuedPodInfo struct {
208208
// latency for a pod.
209209
InitialAttemptTimestamp *time.Time
210210
// UnschedulablePlugins records the plugin names that the Pod failed with Unschedulable or UnschedulableAndUnresolvable status.
211-
// It's registered only when the Pod is rejected in PreFilter, Filter, Reserve, or Permit (WaitOnPermit).
211+
// It's registered only when the Pod is rejected in PreFilter, Filter, Reserve, PreBind or Permit (WaitOnPermit).
212212
UnschedulablePlugins sets.Set[string]
213213
// PendingPlugins records the plugin names that the Pod failed with Pending status.
214214
PendingPlugins sets.Set[string]

pkg/scheduler/schedule_one.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,17 @@ func (sched *Scheduler) bindingCycle(
292292

293293
// Run "prebind" plugins.
294294
if status := fwk.RunPreBindPlugins(ctx, state, assumedPod, scheduleResult.SuggestedHost); !status.IsSuccess() {
295+
if status.IsRejected() {
296+
fitErr := &framework.FitError{
297+
NumAllNodes: 1,
298+
Pod: assumedPodInfo.Pod,
299+
Diagnosis: framework.Diagnosis{
300+
NodeToStatusMap: framework.NodeToStatusMap{scheduleResult.SuggestedHost: status},
301+
UnschedulablePlugins: sets.New(status.Plugin()),
302+
},
303+
}
304+
return framework.NewStatus(status.Code()).WithError(fitErr)
305+
}
295306
return status
296307
}
297308

0 commit comments

Comments
 (0)