@@ -273,14 +273,14 @@ func TestSchedulePlugins(t *testing.T) {
273273 {
274274 name : "all plugins executed successfully, all scorers with same weight" ,
275275 config : SchedulerConfig {
276- PreSchedulePlugins : []plugins.PreSchedule {tp1 , tp2 },
277- Filters : []plugins.Filter {tp1 , tp2 },
278- Scorers : map [plugins.Scorer ]int {
276+ preSchedulePlugins : []plugins.PreSchedule {tp1 , tp2 },
277+ filters : []plugins.Filter {tp1 , tp2 },
278+ scorers : map [plugins.Scorer ]int {
279279 tp1 : 1 ,
280280 tp2 : 1 ,
281281 },
282- Picker : pickerPlugin ,
283- PostSchedulePlugins : []plugins.PostSchedule {tp1 , tp2 },
282+ picker : pickerPlugin ,
283+ postSchedulePlugins : []plugins.PostSchedule {tp1 , tp2 },
284284 },
285285 input : []* backendmetrics.FakePodMetrics {
286286 {Pod : & backend.Pod {NamespacedName : k8stypes.NamespacedName {Name : "pod1" }}},
@@ -295,14 +295,14 @@ func TestSchedulePlugins(t *testing.T) {
295295 {
296296 name : "all plugins executed successfully, different scorers weights" ,
297297 config : SchedulerConfig {
298- PreSchedulePlugins : []plugins.PreSchedule {tp1 , tp2 },
299- Filters : []plugins.Filter {tp1 , tp2 },
300- Scorers : map [plugins.Scorer ]int {
298+ preSchedulePlugins : []plugins.PreSchedule {tp1 , tp2 },
299+ filters : []plugins.Filter {tp1 , tp2 },
300+ scorers : map [plugins.Scorer ]int {
301301 tp1 : 60 ,
302302 tp2 : 40 ,
303303 },
304- Picker : pickerPlugin ,
305- PostSchedulePlugins : []plugins.PostSchedule {tp1 , tp2 },
304+ picker : pickerPlugin ,
305+ postSchedulePlugins : []plugins.PostSchedule {tp1 , tp2 },
306306 },
307307 input : []* backendmetrics.FakePodMetrics {
308308 {Pod : & backend.Pod {NamespacedName : k8stypes.NamespacedName {Name : "pod1" }}},
@@ -317,14 +317,14 @@ func TestSchedulePlugins(t *testing.T) {
317317 {
318318 name : "filter all" ,
319319 config : SchedulerConfig {
320- PreSchedulePlugins : []plugins.PreSchedule {tp1 , tp2 },
321- Filters : []plugins.Filter {tp1 , tp_filterAll },
322- Scorers : map [plugins.Scorer ]int {
320+ preSchedulePlugins : []plugins.PreSchedule {tp1 , tp2 },
321+ filters : []plugins.Filter {tp1 , tp_filterAll },
322+ scorers : map [plugins.Scorer ]int {
323323 tp1 : 1 ,
324324 tp2 : 1 ,
325325 },
326- Picker : pickerPlugin ,
327- PostSchedulePlugins : []plugins.PostSchedule {tp1 , tp2 },
326+ picker : pickerPlugin ,
327+ postSchedulePlugins : []plugins.PostSchedule {tp1 , tp2 },
328328 },
329329 input : []* backendmetrics.FakePodMetrics {
330330 {Pod : & backend.Pod {NamespacedName : k8stypes.NamespacedName {Name : "pod1" }}},
@@ -339,17 +339,17 @@ func TestSchedulePlugins(t *testing.T) {
339339 for _ , test := range tests {
340340 t .Run (test .name , func (t * testing.T ) {
341341 // Reset all plugins before each new test case.
342- for _ , plugin := range test .config .PreSchedulePlugins {
342+ for _ , plugin := range test .config .preSchedulePlugins {
343343 plugin .(* TestPlugin ).reset ()
344344 }
345- for _ , plugin := range test .config .Filters {
345+ for _ , plugin := range test .config .filters {
346346 plugin .(* TestPlugin ).reset ()
347347 }
348- for plugin := range test .config .Scorers {
348+ for plugin := range test .config .scorers {
349349 plugin .(* TestPlugin ).reset ()
350350 }
351- test .config .Picker .(* TestPlugin ).reset ()
352- for _ , plugin := range test .config .PostSchedulePlugins {
351+ test .config .picker .(* TestPlugin ).reset ()
352+ for _ , plugin := range test .config .postSchedulePlugins {
353353 plugin .(* TestPlugin ).reset ()
354354 }
355355
@@ -378,21 +378,21 @@ func TestSchedulePlugins(t *testing.T) {
378378 }
379379
380380 // Validate plugin execution counts dynamically
381- for _ , plugin := range test .config .PreSchedulePlugins {
381+ for _ , plugin := range test .config .preSchedulePlugins {
382382 tp , _ := plugin .(* TestPlugin )
383383 if tp .PreScheduleCallCount != 1 {
384384 t .Errorf ("Plugin %s PreSchedule() called %d times, expected 1" , plugin .Name (), tp .PreScheduleCallCount )
385385 }
386386 }
387387
388- for _ , plugin := range test .config .Filters {
388+ for _ , plugin := range test .config .filters {
389389 tp , _ := plugin .(* TestPlugin )
390390 if tp .FilterCallCount != 1 {
391391 t .Errorf ("Plugin %s Filter() called %d times, expected 1" , plugin .Name (), tp .FilterCallCount )
392392 }
393393 }
394394
395- for plugin := range test .config .Scorers {
395+ for plugin := range test .config .scorers {
396396 tp , _ := plugin .(* TestPlugin )
397397 if tp .ScoreCallCount != 1 {
398398 t .Errorf ("Plugin %s Score() called %d times, expected 1" , plugin .Name (), tp .ScoreCallCount )
@@ -402,7 +402,7 @@ func TestSchedulePlugins(t *testing.T) {
402402 }
403403 }
404404
405- tp , _ := test .config .Picker .(* TestPlugin )
405+ tp , _ := test .config .picker .(* TestPlugin )
406406 if tp .NumOfPickerCandidates != test .numPodsToScore {
407407 t .Errorf ("Picker plugin %s Pick() called with %d candidates, expected %d" , tp .Name (), tp .NumOfPickerCandidates , tp .NumOfScoredPods )
408408 }
@@ -413,7 +413,7 @@ func TestSchedulePlugins(t *testing.T) {
413413 t .Errorf ("winnder pod score %v, expected %v" , tp .WinnderPodScore , test .targetPodScore )
414414 }
415415
416- for _ , plugin := range test .config .PostSchedulePlugins {
416+ for _ , plugin := range test .config .postSchedulePlugins {
417417 tp , _ := plugin .(* TestPlugin )
418418 if tp .PostScheduleCallCount != 1 {
419419 t .Errorf ("Plugin %s PostSchedule() called %d times, expected 1" , plugin .Name (), tp .PostScheduleCallCount )
0 commit comments