Merge pull request #125360 from pohly/dra-scheduler-prebind-pending
scheduler: allow PreBind to return "Pending" and "Unschedulable"
This commit is contained in:
		@@ -208,7 +208,7 @@ type QueuedPodInfo struct {
 | 
				
			|||||||
	// latency for a pod.
 | 
						// latency for a pod.
 | 
				
			||||||
	InitialAttemptTimestamp *time.Time
 | 
						InitialAttemptTimestamp *time.Time
 | 
				
			||||||
	// UnschedulablePlugins records the plugin names that the Pod failed with Unschedulable or UnschedulableAndUnresolvable status.
 | 
						// 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]
 | 
						UnschedulablePlugins sets.Set[string]
 | 
				
			||||||
	// PendingPlugins records the plugin names that the Pod failed with Pending status.
 | 
						// PendingPlugins records the plugin names that the Pod failed with Pending status.
 | 
				
			||||||
	PendingPlugins sets.Set[string]
 | 
						PendingPlugins sets.Set[string]
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -292,6 +292,17 @@ func (sched *Scheduler) bindingCycle(
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	// Run "prebind" plugins.
 | 
						// Run "prebind" plugins.
 | 
				
			||||||
	if status := fwk.RunPreBindPlugins(ctx, state, assumedPod, scheduleResult.SuggestedHost); !status.IsSuccess() {
 | 
						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
 | 
							return status
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user