@@ -91,7 +91,6 @@ type fakeExtender struct {
91
91
interestedPodName string
92
92
ignorable bool
93
93
gotBind bool
94
- isPrioritizer bool
95
94
errBind bool
96
95
}
97
96
@@ -145,10 +144,6 @@ func (f *fakeExtender) IsInterested(pod *v1.Pod) bool {
145
144
return pod != nil && pod .Name == f .interestedPodName
146
145
}
147
146
148
- func (f * fakeExtender ) IsPrioritizer () bool {
149
- return f .isPrioritizer
150
- }
151
-
152
147
type falseMapPlugin struct {}
153
148
154
149
func newFalseMapPlugin () frameworkruntime.PluginFactory {
@@ -1828,7 +1823,6 @@ func TestSchedulerSchedulePod(t *testing.T) {
1828
1823
registerPlugins : []tf.RegisterPluginFunc {
1829
1824
tf .RegisterQueueSortPlugin (queuesort .Name , queuesort .New ),
1830
1825
tf .RegisterFilterPlugin ("TrueFilter" , tf .NewTrueFilterPlugin ),
1831
- tf .RegisterScorePlugin ("EqualPrioritizerPlugin" , tf .NewEqualPrioritizerPlugin (), 20 ),
1832
1826
tf .RegisterBindPlugin (defaultbinder .Name , defaultbinder .New ),
1833
1827
},
1834
1828
nodes : []string {"node1" , "node2" },
@@ -1946,7 +1940,6 @@ func TestSchedulerSchedulePod(t *testing.T) {
1946
1940
tf .RegisterQueueSortPlugin (queuesort .Name , queuesort .New ),
1947
1941
tf .RegisterPreFilterPlugin (volumebinding .Name , frameworkruntime .FactoryAdapter (fts , volumebinding .New )),
1948
1942
tf .RegisterFilterPlugin ("TrueFilter" , tf .NewTrueFilterPlugin ),
1949
- tf .RegisterScorePlugin ("EqualPrioritizerPlugin" , tf .NewEqualPrioritizerPlugin (), 20 ),
1950
1943
tf .RegisterBindPlugin (defaultbinder .Name , defaultbinder .New ),
1951
1944
},
1952
1945
nodes : []string {"node1" , "node2" },
@@ -2060,7 +2053,6 @@ func TestSchedulerSchedulePod(t *testing.T) {
2060
2053
"PreFilter" ,
2061
2054
"Filter" ,
2062
2055
),
2063
- tf .RegisterScorePlugin ("EqualPrioritizerPlugin" , tf .NewEqualPrioritizerPlugin (), 20 ),
2064
2056
tf .RegisterBindPlugin (defaultbinder .Name , defaultbinder .New ),
2065
2057
},
2066
2058
nodes : []string {"node1" , "node2" , "node3" },
@@ -2363,7 +2355,6 @@ func TestSchedulerSchedulePod(t *testing.T) {
2363
2355
},
2364
2356
}, nil
2365
2357
}, "PreFilter" , "Filter" ),
2366
- tf .RegisterScorePlugin ("EqualPrioritizerPlugin" , tf .NewEqualPrioritizerPlugin (), 20 ),
2367
2358
tf .RegisterBindPlugin (defaultbinder .Name , defaultbinder .New ),
2368
2359
},
2369
2360
nodes : []string {"node1" , "node2" , "node3" },
@@ -2386,33 +2377,6 @@ func TestSchedulerSchedulePod(t *testing.T) {
2386
2377
pod : st .MakePod ().Name ("ignore" ).UID ("ignore" ).Obj (),
2387
2378
wantNodes : sets .New ("node1" , "node2" ),
2388
2379
},
2389
- {
2390
- name : "test without score plugin no extra nodes are evaluated" ,
2391
- registerPlugins : []tf.RegisterPluginFunc {
2392
- tf .RegisterQueueSortPlugin (queuesort .Name , queuesort .New ),
2393
- tf .RegisterFilterPlugin ("TrueFilter" , tf .NewTrueFilterPlugin ),
2394
- tf .RegisterBindPlugin (defaultbinder .Name , defaultbinder .New ),
2395
- },
2396
- nodes : []string {"node1" , "node2" , "node3" },
2397
- pod : st .MakePod ().Name ("pod1" ).UID ("pod1" ).Obj (),
2398
- wantNodes : sets .New ("node1" , "node2" , "node3" ),
2399
- wantEvaluatedNodes : ptr.To [int32 ](1 ),
2400
- },
2401
- {
2402
- name : "test no score plugin, prefilter plugin returning 2 nodes, only 1 node is evaluated in Filter" ,
2403
- registerPlugins : []tf.RegisterPluginFunc {
2404
- tf .RegisterQueueSortPlugin (queuesort .Name , queuesort .New ),
2405
- tf .RegisterPreFilterPlugin (
2406
- "FakePreFilter" ,
2407
- tf .NewFakePreFilterPlugin ("FakePreFilter" , & framework.PreFilterResult {NodeNames : sets .New ("node1" , "node2" )}, nil ),
2408
- ),
2409
- tf .RegisterBindPlugin (defaultbinder .Name , defaultbinder .New ),
2410
- },
2411
- nodes : []string {"node1" , "node2" , "node3" },
2412
- pod : st .MakePod ().Name ("test-prefilter" ).UID ("test-prefilter" ).Obj (),
2413
- wantNodes : sets .New ("node1" , "node2" ),
2414
- wantEvaluatedNodes : ptr.To [int32 ](2 ),
2415
- },
2416
2380
}
2417
2381
for _ , test := range tests {
2418
2382
t .Run (test .name , func (t * testing.T ) {
@@ -2786,7 +2750,7 @@ func TestZeroRequest(t *testing.T) {
2786
2750
t .Fatalf ("error filtering nodes: %+v" , err )
2787
2751
}
2788
2752
fwk .RunPreScorePlugins (ctx , state , test .pod , tf .BuildNodeInfos (test .nodes ))
2789
- list , err := sched . prioritizeNodes (ctx , fwk , state , test .pod , tf .BuildNodeInfos (test .nodes ))
2753
+ list , err := prioritizeNodes (ctx , nil , fwk , state , test .pod , tf .BuildNodeInfos (test .nodes ))
2790
2754
if err != nil {
2791
2755
t .Errorf ("unexpected error: %v" , err )
2792
2756
}
@@ -3182,10 +3146,7 @@ func Test_prioritizeNodes(t *testing.T) {
3182
3146
for ii := range test .extenders {
3183
3147
extenders = append (extenders , & test .extenders [ii ])
3184
3148
}
3185
- sched := & Scheduler {
3186
- Extenders : extenders ,
3187
- }
3188
- nodesscores , err := sched .prioritizeNodes (ctx , fwk , state , test .pod , tf .BuildNodeInfos (test .nodes ))
3149
+ nodesscores , err := prioritizeNodes (ctx , extenders , fwk , state , test .pod , tf .BuildNodeInfos (test .nodes ))
3189
3150
if err != nil {
3190
3151
t .Errorf ("unexpected error: %v" , err )
3191
3152
}
@@ -3288,7 +3249,6 @@ func TestFairEvaluationForNodes(t *testing.T) {
3288
3249
[]tf.RegisterPluginFunc {
3289
3250
tf .RegisterQueueSortPlugin (queuesort .Name , queuesort .New ),
3290
3251
tf .RegisterFilterPlugin ("TrueFilter" , tf .NewTrueFilterPlugin ),
3291
- tf .RegisterScorePlugin ("EqualPrioritizerPlugin" , tf .NewEqualPrioritizerPlugin (), 20 ),
3292
3252
tf .RegisterBindPlugin (defaultbinder .Name , defaultbinder .New ),
3293
3253
},
3294
3254
"" ,
@@ -3367,7 +3327,6 @@ func TestPreferNominatedNodeFilterCallCounts(t *testing.T) {
3367
3327
registerPlugins := []tf.RegisterPluginFunc {
3368
3328
tf .RegisterQueueSortPlugin (queuesort .Name , queuesort .New ),
3369
3329
registerFakeFilterFunc ,
3370
- tf .RegisterScorePlugin ("EqualPrioritizerPlugin" , tf .NewEqualPrioritizerPlugin (), 20 ),
3371
3330
tf .RegisterBindPlugin (defaultbinder .Name , defaultbinder .New ),
3372
3331
}
3373
3332
fwk , err := tf .NewFramework (
0 commit comments