mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-31 07:20:13 +00:00
Merge pull request #125360 from pohly/dra-scheduler-prebind-pending
scheduler: allow PreBind to return "Pending" and "Unschedulable"
This commit is contained in:
commit
96827ea6bf
@ -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]
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user