Fix the wrong status returned from RunPreFilterPlugins

event msg will be impacted due to the wrong status is returned.
e.g.

Warning  FailedScheduling ... running PreFilter plugin "PodTopologySpread": %!!(MISSING)w(<nil>)

Signed-off-by: Dave Chen <dave.chen@arm.com>
This commit is contained in:
Dave Chen
2022-08-25 19:21:28 +08:00
parent a1128e380c
commit 8a288d6406
2 changed files with 29 additions and 1 deletions

View File

@@ -605,7 +605,7 @@ func (f *frameworkImpl) RunPreFilterPlugins(ctx context.Context, state *framewor
if s.IsUnschedulable() {
return nil, s
}
return nil, framework.AsStatus(fmt.Errorf("running PreFilter plugin %q: %w", pl.Name(), status.AsError())).WithFailedPlugin(pl.Name())
return nil, framework.AsStatus(fmt.Errorf("running PreFilter plugin %q: %w", pl.Name(), s.AsError())).WithFailedPlugin(pl.Name())
}
if !r.AllNodes() {
pluginsWithNodes = append(pluginsWithNodes, pl.Name())