mirror of
https://github.com/kubernetes/kubernetes.git
synced 2026-06-11 01:41:54 -04:00
Simplify status handling of scheduler RunFilterPlugins
This commit is contained in:
parent
99cc89b7da
commit
92ba2a4e09
1 changed files with 2 additions and 6 deletions
|
|
@ -424,19 +424,15 @@ func (f *framework) RunFilterPlugins(
|
|||
pod *v1.Pod,
|
||||
nodeInfo *NodeInfo,
|
||||
) PluginToStatus {
|
||||
var firstFailedStatus *Status
|
||||
statuses := make(PluginToStatus)
|
||||
for _, pl := range f.filterPlugins {
|
||||
pluginStatus := f.runFilterPlugin(ctx, pl, state, pod, nodeInfo)
|
||||
if len(statuses) == 0 {
|
||||
firstFailedStatus = pluginStatus
|
||||
}
|
||||
if !pluginStatus.IsSuccess() {
|
||||
if !pluginStatus.IsUnschedulable() {
|
||||
// Filter plugins are not supposed to return any status other than
|
||||
// Success or Unschedulable.
|
||||
firstFailedStatus = 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}
|
||||
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(): errStatus}
|
||||
}
|
||||
statuses[pl.Name()] = pluginStatus
|
||||
if !f.runAllFilters {
|
||||
|
|
|
|||
Loading…
Reference in a new issue