Skip to content

Commit ab8a7dd

Browse files
committed
Revert "scheduler: preallocation for NodeToStatusMap"
This reverts commit 9fcd791.
1 parent 92d7c7a commit ab8a7dd

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

pkg/scheduler/schedule_one.go

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -422,18 +422,14 @@ func (sched *Scheduler) schedulePod(ctx context.Context, fwk framework.Framework
422422
// filter plugins and filter extenders.
423423
func (sched *Scheduler) findNodesThatFitPod(ctx context.Context, fwk framework.Framework, state *framework.CycleState, pod *v1.Pod) ([]*v1.Node, framework.Diagnosis, error) {
424424
logger := klog.FromContext(ctx)
425+
diagnosis := framework.Diagnosis{
426+
NodeToStatusMap: make(framework.NodeToStatusMap),
427+
UnschedulablePlugins: sets.New[string](),
428+
}
425429

426430
allNodes, err := sched.nodeInfoSnapshot.NodeInfos().List()
427431
if err != nil {
428-
return nil, framework.Diagnosis{
429-
NodeToStatusMap: make(framework.NodeToStatusMap),
430-
UnschedulablePlugins: sets.New[string](),
431-
}, err
432-
}
433-
434-
diagnosis := framework.Diagnosis{
435-
NodeToStatusMap: make(framework.NodeToStatusMap, len(allNodes)),
436-
UnschedulablePlugins: sets.New[string](),
432+
return nil, diagnosis, err
437433
}
438434
// Run "prefilter" plugins.
439435
preRes, s := fwk.RunPreFilterPlugins(ctx, state, pod)

0 commit comments

Comments
 (0)