@@ -166,12 +166,6 @@ func (g *genericScheduler) Schedule(ctx context.Context, prof *profile.Profile,
166
166
}
167
167
168
168
// Run "prefilter" plugins.
169
- preFilterStatus := prof .RunPreFilterPlugins (ctx , state , pod )
170
- if ! preFilterStatus .IsSuccess () {
171
- return result , preFilterStatus .AsError ()
172
- }
173
- trace .Step ("Running prefilter plugins done" )
174
-
175
169
startPredicateEvalTime := time .Now ()
176
170
filteredNodes , filteredNodesStatuses , err := g .findNodesThatFitPod (ctx , prof , state , pod )
177
171
if err != nil {
@@ -187,13 +181,6 @@ func (g *genericScheduler) Schedule(ctx context.Context, prof *profile.Profile,
187
181
}
188
182
}
189
183
190
- // Run "prescore" plugins.
191
- prescoreStatus := prof .RunPreScorePlugins (ctx , state , pod , filteredNodes )
192
- if ! prescoreStatus .IsSuccess () {
193
- return result , prescoreStatus .AsError ()
194
- }
195
- trace .Step ("Running prescore plugins done" )
196
-
197
184
metrics .DeprecatedSchedulingAlgorithmPredicateEvaluationSecondsDuration .Observe (metrics .SinceInSeconds (startPredicateEvalTime ))
198
185
metrics .DeprecatedSchedulingDuration .WithLabelValues (metrics .PredicateEvaluation ).Observe (metrics .SinceInSeconds (startPredicateEvalTime ))
199
186
@@ -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