Remove duplicated error log in framework

This commit is contained in:
drfish 2021-01-31 17:17:03 +08:00
parent c241a237f9
commit b9ab8768b6

View File

@ -435,9 +435,7 @@ func (f *frameworkImpl) RunPreFilterPlugins(ctx context.Context, state *framewor
if status.IsUnschedulable() { if status.IsUnschedulable() {
return status return status
} }
err := status.AsError() return framework.AsStatus(fmt.Errorf("running PreFilter plugin %q: %w", pl.Name(), status.AsError())).WithFailedPlugin(pl.Name())
klog.ErrorS(err, "Failed running PreFilter plugin", "plugin", pl.Name(), "pod", klog.KObj(pod))
return framework.AsStatus(fmt.Errorf("running PreFilter plugin %q: %w", pl.Name(), err)).WithFailedPlugin(pl.Name())
} }
} }
@ -699,9 +697,7 @@ func (f *frameworkImpl) RunPreScorePlugins(
for _, pl := range f.preScorePlugins { for _, pl := range f.preScorePlugins {
status = f.runPreScorePlugin(ctx, pl, state, pod, nodes) status = f.runPreScorePlugin(ctx, pl, state, pod, nodes)
if !status.IsSuccess() { if !status.IsSuccess() {
err := status.AsError() return framework.AsStatus(fmt.Errorf("running PreScore plugin %q: %w", pl.Name(), status.AsError()))
klog.ErrorS(err, "Failed running PreScore plugin", "plugin", pl.Name(), "pod", klog.KObj(pod))
return framework.AsStatus(fmt.Errorf("running PreScore plugin %q: %w", pl.Name(), err))
} }
} }
@ -751,7 +747,6 @@ func (f *frameworkImpl) RunScorePlugins(ctx context.Context, state *framework.Cy
} }
}) })
if err := errCh.ReceiveError(); err != nil { if err := errCh.ReceiveError(); err != nil {
klog.ErrorS(err, "Failed running Score plugins", "pod", klog.KObj(pod))
return nil, framework.AsStatus(fmt.Errorf("running Score plugins: %w", err)) return nil, framework.AsStatus(fmt.Errorf("running Score plugins: %w", err))
} }
@ -770,7 +765,6 @@ func (f *frameworkImpl) RunScorePlugins(ctx context.Context, state *framework.Cy
} }
}) })
if err := errCh.ReceiveError(); err != nil { if err := errCh.ReceiveError(); err != nil {
klog.ErrorS(err, "Failed running Normalize on Score plugins", "pod", klog.KObj(pod))
return nil, framework.AsStatus(fmt.Errorf("running Normalize on Score plugins: %w", err)) return nil, framework.AsStatus(fmt.Errorf("running Normalize on Score plugins: %w", err))
} }
@ -792,7 +786,6 @@ func (f *frameworkImpl) RunScorePlugins(ctx context.Context, state *framework.Cy
} }
}) })
if err := errCh.ReceiveError(); err != nil { if err := errCh.ReceiveError(); err != nil {
klog.ErrorS(err, "Failed applying score defaultWeights on Score plugins", "pod", klog.KObj(pod))
return nil, framework.AsStatus(fmt.Errorf("applying score defaultWeights on Score plugins: %w", err)) return nil, framework.AsStatus(fmt.Errorf("applying score defaultWeights on Score plugins: %w", err))
} }