mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-26 21:17:23 +00:00
Merge pull request #90467 from Huang-Wei/honor-runAllFilters
Simplify status handling of scheduler RunFilterPlugins
This commit is contained in:
commit
fabe9cddf1
@ -424,19 +424,15 @@ func (f *framework) RunFilterPlugins(
|
|||||||
pod *v1.Pod,
|
pod *v1.Pod,
|
||||||
nodeInfo *NodeInfo,
|
nodeInfo *NodeInfo,
|
||||||
) PluginToStatus {
|
) PluginToStatus {
|
||||||
var firstFailedStatus *Status
|
|
||||||
statuses := make(PluginToStatus)
|
statuses := make(PluginToStatus)
|
||||||
for _, pl := range f.filterPlugins {
|
for _, pl := range f.filterPlugins {
|
||||||
pluginStatus := f.runFilterPlugin(ctx, pl, state, pod, nodeInfo)
|
pluginStatus := f.runFilterPlugin(ctx, pl, state, pod, nodeInfo)
|
||||||
if len(statuses) == 0 {
|
|
||||||
firstFailedStatus = pluginStatus
|
|
||||||
}
|
|
||||||
if !pluginStatus.IsSuccess() {
|
if !pluginStatus.IsSuccess() {
|
||||||
if !pluginStatus.IsUnschedulable() {
|
if !pluginStatus.IsUnschedulable() {
|
||||||
// Filter plugins are not supposed to return any status other than
|
// Filter plugins are not supposed to return any status other than
|
||||||
// Success or Unschedulable.
|
// Success or Unschedulable.
|
||||||
firstFailedStatus = NewStatus(Error, fmt.Sprintf("running %q filter plugin for pod %q: %v", pl.Name(), pod.Name, pluginStatus.Message()))
|
errStatus := NewStatus(Error, fmt.Sprintf("running %q filter plugin for pod %q: %v", pl.Name(), pod.Name, pluginStatus.Message()))
|
||||||
return map[string]*Status{pl.Name(): firstFailedStatus}
|
return map[string]*Status{pl.Name(): errStatus}
|
||||||
}
|
}
|
||||||
statuses[pl.Name()] = pluginStatus
|
statuses[pl.Name()] = pluginStatus
|
||||||
if !f.runAllFilters {
|
if !f.runAllFilters {
|
||||||
|
Loading…
Reference in New Issue
Block a user