fix: update run filter plugin for consistency

This commit is contained in:
draveness 2019-07-31 15:27:03 +08:00
parent feb64858aa
commit 859cac0595

View File

@ -312,13 +312,12 @@ func (f *framework) RunPrefilterPlugins(
// Meanwhile, the failure message and status are set for the given node. // Meanwhile, the failure message and status are set for the given node.
func (f *framework) RunFilterPlugins(pc *PluginContext, func (f *framework) RunFilterPlugins(pc *PluginContext,
pod *v1.Pod, nodeName string) *Status { pod *v1.Pod, nodeName string) *Status {
for _, pl := range f.filterPlugins {
for _, p := range f.filterPlugins { status := pl.Filter(pc, pod, nodeName)
status := p.Filter(pc, pod, nodeName)
if !status.IsSuccess() { if !status.IsSuccess() {
if status.Code() != Unschedulable { if status.Code() != Unschedulable {
errMsg := fmt.Sprintf("RunFilterPlugins: error while running %s filter plugin for pod %s: %s", errMsg := fmt.Sprintf("RunFilterPlugins: error while running %v filter plugin for pod %v: %v",
p.Name(), pod.Name, status.Message()) pl.Name(), pod.Name, status.Message())
klog.Error(errMsg) klog.Error(errMsg)
return NewStatus(Error, errMsg) return NewStatus(Error, errMsg)
} }