mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-20 02:11:09 +00:00
Merge pull request #116287 from csDengh/minor_code_improvement
scheduler: get an element from the nodes slice out of the loop for the better performance
This commit is contained in:
commit
89d1a7971e
@ -952,8 +952,8 @@ func (f *frameworkImpl) RunScorePlugins(ctx context.Context, state *framework.Cy
|
|||||||
if len(plugins) > 0 {
|
if len(plugins) > 0 {
|
||||||
// Run Score method for each node in parallel.
|
// Run Score method for each node in parallel.
|
||||||
f.Parallelizer().Until(ctx, len(nodes), func(index int) {
|
f.Parallelizer().Until(ctx, len(nodes), func(index int) {
|
||||||
|
nodeName := nodes[index].Name
|
||||||
for _, pl := range plugins {
|
for _, pl := range plugins {
|
||||||
nodeName := nodes[index].Name
|
|
||||||
s, status := f.runScorePlugin(ctx, pl, state, pod, nodeName)
|
s, status := f.runScorePlugin(ctx, pl, state, pod, nodeName)
|
||||||
if !status.IsSuccess() {
|
if !status.IsSuccess() {
|
||||||
err := fmt.Errorf("plugin %q failed with: %w", pl.Name(), status.AsError())
|
err := fmt.Errorf("plugin %q failed with: %w", pl.Name(), status.AsError())
|
||||||
|
Loading…
Reference in New Issue
Block a user