mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-04 18:00:08 +00:00
Make sure skip score plugins alwarys returned
Signed-off-by: kerthcet <kerthcet@gmail.com>
This commit is contained in:
parent
fb785f1f42
commit
ab01848134
@ -969,10 +969,11 @@ func (f *frameworkImpl) RunPreScorePlugins(
|
|||||||
nodes []*v1.Node,
|
nodes []*v1.Node,
|
||||||
) (status *framework.Status) {
|
) (status *framework.Status) {
|
||||||
startTime := time.Now()
|
startTime := time.Now()
|
||||||
|
skipPlugins := sets.New[string]()
|
||||||
defer func() {
|
defer func() {
|
||||||
|
state.SkipScorePlugins = skipPlugins
|
||||||
metrics.FrameworkExtensionPointDuration.WithLabelValues(metrics.PreScore, status.Code().String(), f.profileName).Observe(metrics.SinceInSeconds(startTime))
|
metrics.FrameworkExtensionPointDuration.WithLabelValues(metrics.PreScore, status.Code().String(), f.profileName).Observe(metrics.SinceInSeconds(startTime))
|
||||||
}()
|
}()
|
||||||
skipPlugins := sets.New[string]()
|
|
||||||
logger := klog.FromContext(ctx)
|
logger := klog.FromContext(ctx)
|
||||||
logger = klog.LoggerWithName(logger, "PreScore")
|
logger = klog.LoggerWithName(logger, "PreScore")
|
||||||
// TODO(knelasevero): Remove duplicated keys from log entry calls
|
// TODO(knelasevero): Remove duplicated keys from log entry calls
|
||||||
@ -991,7 +992,6 @@ func (f *frameworkImpl) RunPreScorePlugins(
|
|||||||
return framework.AsStatus(fmt.Errorf("running PreScore plugin %q: %w", pl.Name(), status.AsError()))
|
return framework.AsStatus(fmt.Errorf("running PreScore plugin %q: %w", pl.Name(), status.AsError()))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
state.SkipScorePlugins = skipPlugins
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -952,7 +952,8 @@ func TestRunPreScorePlugins(t *testing.T) {
|
|||||||
inj: injectedResult{PreScoreStatus: int(framework.Error)},
|
inj: injectedResult{PreScoreStatus: int(framework.Error)},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
wantStatusCode: framework.Error,
|
wantSkippedPlugins: sets.New("skip"),
|
||||||
|
wantStatusCode: framework.Error,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "all PreScore plugins returned skip",
|
name: "all PreScore plugins returned skip",
|
||||||
|
Loading…
Reference in New Issue
Block a user