@@ -167,12 +167,6 @@ func (g *genericScheduler) Schedule(ctx context.Context, prof *profile.Profile,
167
167
168
168
// Run "prefilter" plugins.
169
169
startPredicateEvalTime := time .Now ()
170
- preFilterStatus := prof .RunPreFilterPlugins (ctx , state , pod )
171
- if ! preFilterStatus .IsSuccess () {
172
- return result , preFilterStatus .AsError ()
173
- }
174
- trace .Step ("Running prefilter plugins done" )
175
-
176
170
filteredNodes , filteredNodesStatuses , err := g .findNodesThatFitPod (ctx , prof , state , pod )
177
171
if err != nil {
178
172
return result , err
@@ -201,13 +195,6 @@ func (g *genericScheduler) Schedule(ctx context.Context, prof *profile.Profile,
201
195
}, nil
202
196
}
203
197
204
- // Run "prescore" plugins.
205
- prescoreStatus := prof .RunPreScorePlugins (ctx , state , pod , filteredNodes )
206
- if ! prescoreStatus .IsSuccess () {
207
- return result , prescoreStatus .AsError ()
208
- }
209
- trace .Step ("Running prescore plugins done" )
210
-
211
198
priorityList , err := g .prioritizeNodes (ctx , prof , state , pod , filteredNodes )
212
199
if err != nil {
213
200
return result , err
@@ -412,6 +399,11 @@ func (g *genericScheduler) numFeasibleNodesToFind(numAllNodes int32) (numNodes i
412
399
// Filters the nodes to find the ones that fit the pod based on the framework
413
400
// filter plugins and filter extenders.
414
401
func (g * genericScheduler ) findNodesThatFitPod (ctx context.Context , prof * profile.Profile , state * framework.CycleState , pod * v1.Pod ) ([]* v1.Node , framework.NodeToStatusMap , error ) {
402
+ s := prof .RunPreFilterPlugins (ctx , state , pod )
403
+ if ! s .IsSuccess () {
404
+ return nil , nil , s .AsError ()
405
+ }
406
+
415
407
filteredNodesStatuses := make (framework.NodeToStatusMap )
416
408
filtered , err := g .findNodesThatPassFilters (ctx , prof , state , pod , filteredNodesStatuses )
417
409
if err != nil {
@@ -643,10 +635,16 @@ func (g *genericScheduler) prioritizeNodes(
643
635
return result , nil
644
636
}
645
637
638
+ // Run PreScore plugins.
639
+ preScoreStatus := prof .RunPreScorePlugins (ctx , state , pod , nodes )
640
+ if ! preScoreStatus .IsSuccess () {
641
+ return nil , preScoreStatus .AsError ()
642
+ }
643
+
646
644
// Run the Score plugins.
647
645
scoresMap , scoreStatus := prof .RunScorePlugins (ctx , state , pod , nodes )
648
646
if ! scoreStatus .IsSuccess () {
649
- return framework. NodeScoreList {} , scoreStatus .AsError ()
647
+ return nil , scoreStatus .AsError ()
650
648
}
651
649
652
650
// Summarize all scores.
0 commit comments