@@ -31,10 +31,10 @@ import (
31
31
)
32
32
33
33
const (
34
- testProfileHandlerName = "test-profile-handler"
35
- test1Name = "test-one"
36
- test2Name = "test-two"
37
- testPickerName = "test-picker"
34
+ testProfileHandlerType = "test-profile-handler"
35
+ test1Type = "test-one"
36
+ test2Type = "test-two"
37
+ testPickerType = "test-picker"
38
38
)
39
39
40
40
func TestLoadConfiguration (t * testing.T ) {
@@ -50,21 +50,21 @@ func TestLoadConfiguration(t *testing.T) {
50
50
Plugins : []configapi.PluginSpec {
51
51
{
52
52
Name : "test1" ,
53
- PluginName : test1Name ,
53
+ PluginName : test1Type ,
54
54
Parameters : json .RawMessage ("{\" threshold\" :10}" ),
55
55
},
56
56
{
57
57
Name : "profileHandler" ,
58
58
PluginName : "test-profile-handler" ,
59
59
},
60
60
{
61
- Name : test2Name ,
62
- PluginName : test2Name ,
61
+ Name : test2Type ,
62
+ PluginName : test2Type ,
63
63
Parameters : json .RawMessage ("{\" hashBlockSize\" :32}" ),
64
64
},
65
65
{
66
66
Name : "testPicker" ,
67
- PluginName : testPickerName ,
67
+ PluginName : testPickerType ,
68
68
},
69
69
},
70
70
SchedulingProfiles : []configapi.SchedulingProfile {
@@ -463,8 +463,8 @@ type test1 struct {
463
463
Threshold int `json:"threshold"`
464
464
}
465
465
466
- func (f * test1 ) Name () string {
467
- return test1Name
466
+ func (f * test1 ) Type () string {
467
+ return test1Type
468
468
}
469
469
470
470
// Filter filters out pods that doesn't meet the filter criteria.
@@ -478,8 +478,8 @@ var _ framework.PostCycle = &test2{}
478
478
479
479
type test2 struct {}
480
480
481
- func (f * test2 ) Name () string {
482
- return test2Name
481
+ func (f * test2 ) Type () string {
482
+ return test2Type
483
483
}
484
484
485
485
func (m * test2 ) Score (ctx context.Context , request * types.LLMRequest , cycleState * types.CycleState , pods []types.Pod ) map [types.Pod ]float64 {
@@ -494,8 +494,8 @@ var _ framework.Picker = &testPicker{}
494
494
495
495
type testPicker struct {}
496
496
497
- func (p * testPicker ) Name () string {
498
- return testPickerName
497
+ func (p * testPicker ) Type () string {
498
+ return testPickerType
499
499
}
500
500
501
501
func (p * testPicker ) Pick (ctx context.Context , cycleState * types.CycleState , scoredPods []* types.ScoredPod ) * types.ProfileRunResult {
@@ -507,8 +507,8 @@ var _ framework.ProfileHandler = &testProfileHandler{}
507
507
508
508
type testProfileHandler struct {}
509
509
510
- func (p * testProfileHandler ) Name () string {
511
- return testProfileHandlerName
510
+ func (p * testProfileHandler ) Type () string {
511
+ return testProfileHandlerType
512
512
}
513
513
514
514
func (p * testProfileHandler ) Pick (ctx context.Context , request * types.LLMRequest , profiles map [string ]* framework.SchedulerProfile , executionResults map [string ]* types.ProfileRunResult ) map [string ]* framework.SchedulerProfile {
@@ -520,27 +520,27 @@ func (p *testProfileHandler) ProcessResults(ctx context.Context, request *types.
520
520
}
521
521
522
522
func registerTestPlugins () {
523
- plugins .Register (test1Name ,
523
+ plugins .Register (test1Type ,
524
524
func (name string , parameters json.RawMessage , handle plugins.Handle ) (plugins.Plugin , error ) {
525
525
result := test1 {}
526
526
err := json .Unmarshal (parameters , & result )
527
527
return & result , err
528
528
},
529
529
)
530
530
531
- plugins .Register (test2Name ,
531
+ plugins .Register (test2Type ,
532
532
func (name string , parameters json.RawMessage , handle plugins.Handle ) (plugins.Plugin , error ) {
533
533
return & test2 {}, nil
534
534
},
535
535
)
536
536
537
- plugins .Register (testPickerName ,
537
+ plugins .Register (testPickerType ,
538
538
func (name string , parameters json.RawMessage , handle plugins.Handle ) (plugins.Plugin , error ) {
539
539
return & testPicker {}, nil
540
540
},
541
541
)
542
542
543
- plugins .Register (testProfileHandlerName ,
543
+ plugins .Register (testProfileHandlerType ,
544
544
func (name string , parameters json.RawMessage , handle plugins.Handle ) (plugins.Plugin , error ) {
545
545
return & testProfileHandler {}, nil
546
546
},
0 commit comments