Skip to content

Commit 7ea3bf4

Browse files
committed
Revert "scheduler: preallocation for NodeToStatusMap"
This reverts commit 9fcd791.
1 parent 6809180 commit 7ea3bf4

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

pkg/scheduler/schedule_one.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -441,14 +441,13 @@ func (sched *Scheduler) schedulePod(ctx context.Context, fwk framework.Framework
441441
// filter plugins and filter extenders.
442442
func (sched *Scheduler) findNodesThatFitPod(ctx context.Context, fwk framework.Framework, state *framework.CycleState, pod *v1.Pod) ([]*framework.NodeInfo, framework.Diagnosis, error) {
443443
logger := klog.FromContext(ctx)
444+
diagnosis := framework.Diagnosis{
445+
NodeToStatusMap: make(framework.NodeToStatusMap),
446+
}
444447

445448
allNodes, err := sched.nodeInfoSnapshot.NodeInfos().List()
446449
if err != nil {
447-
return nil, framework.Diagnosis{}, err
448-
}
449-
450-
diagnosis := framework.Diagnosis{
451-
NodeToStatusMap: make(framework.NodeToStatusMap, len(allNodes)),
450+
return nil, diagnosis, err
452451
}
453452
// Run "prefilter" plugins.
454453
preRes, s := fwk.RunPreFilterPlugins(ctx, state, pod)

0 commit comments

Comments
 (0)