@@ -36,10 +36,10 @@ import (
36
36
)
37
37
38
38
const (
39
- testProfileHandlerName = "test-profile-handler"
40
- test1Name = "test-one"
41
- test2Name = "test-two"
42
- testPickerName = "test-picker"
39
+ testProfileHandlerType = "test-profile-handler"
40
+ test1Type = "test-one"
41
+ test2Type = "test-two"
42
+ testPickerType = "test-picker"
43
43
)
44
44
45
45
func TestLoadConfiguration (t * testing.T ) {
@@ -55,21 +55,21 @@ func TestLoadConfiguration(t *testing.T) {
55
55
Plugins : []configapi.PluginSpec {
56
56
{
57
57
Name : "test1" ,
58
- PluginName : test1Name ,
58
+ PluginName : test1Type ,
59
59
Parameters : json .RawMessage ("{\" threshold\" :10}" ),
60
60
},
61
61
{
62
62
Name : "profileHandler" ,
63
63
PluginName : "test-profile-handler" ,
64
64
},
65
65
{
66
- Name : test2Name ,
67
- PluginName : test2Name ,
66
+ Name : test2Type ,
67
+ PluginName : test2Type ,
68
68
Parameters : json .RawMessage ("{\" hashBlockSize\" :32}" ),
69
69
},
70
70
{
71
71
Name : "testPicker" ,
72
- PluginName : testPickerName ,
72
+ PluginName : testPickerType ,
73
73
},
74
74
},
75
75
SchedulingProfiles : []configapi.SchedulingProfile {
@@ -552,8 +552,8 @@ type test1 struct {
552
552
Threshold int `json:"threshold"`
553
553
}
554
554
555
- func (f * test1 ) Name () string {
556
- return test1Name
555
+ func (f * test1 ) Type () string {
556
+ return test1Type
557
557
}
558
558
559
559
// Filter filters out pods that doesn't meet the filter criteria.
@@ -567,8 +567,8 @@ var _ framework.PostCycle = &test2{}
567
567
568
568
type test2 struct {}
569
569
570
- func (f * test2 ) Name () string {
571
- return test2Name
570
+ func (f * test2 ) Type () string {
571
+ return test2Type
572
572
}
573
573
574
574
func (m * test2 ) Score (ctx context.Context , request * types.LLMRequest , cycleState * types.CycleState , pods []types.Pod ) map [types.Pod ]float64 {
@@ -583,8 +583,8 @@ var _ framework.Picker = &testPicker{}
583
583
584
584
type testPicker struct {}
585
585
586
- func (p * testPicker ) Name () string {
587
- return testPickerName
586
+ func (p * testPicker ) Type () string {
587
+ return testPickerType
588
588
}
589
589
590
590
func (p * testPicker ) Pick (ctx context.Context , cycleState * types.CycleState , scoredPods []* types.ScoredPod ) * types.ProfileRunResult {
@@ -596,8 +596,8 @@ var _ framework.ProfileHandler = &testProfileHandler{}
596
596
597
597
type testProfileHandler struct {}
598
598
599
- func (p * testProfileHandler ) Name () string {
600
- return testProfileHandlerName
599
+ func (p * testProfileHandler ) Type () string {
600
+ return testProfileHandlerType
601
601
}
602
602
603
603
func (p * testProfileHandler ) Pick (ctx context.Context , request * types.LLMRequest , profiles map [string ]* framework.SchedulerProfile , executionResults map [string ]* types.ProfileRunResult ) map [string ]* framework.SchedulerProfile {
@@ -609,27 +609,27 @@ func (p *testProfileHandler) ProcessResults(ctx context.Context, request *types.
609
609
}
610
610
611
611
func registerTestPlugins () {
612
- plugins .Register (test1Name ,
612
+ plugins .Register (test1Type ,
613
613
func (name string , parameters json.RawMessage , handle plugins.Handle ) (plugins.Plugin , error ) {
614
614
result := test1 {}
615
615
err := json .Unmarshal (parameters , & result )
616
616
return & result , err
617
617
},
618
618
)
619
619
620
- plugins .Register (test2Name ,
620
+ plugins .Register (test2Type ,
621
621
func (name string , parameters json.RawMessage , handle plugins.Handle ) (plugins.Plugin , error ) {
622
622
return & test2 {}, nil
623
623
},
624
624
)
625
625
626
- plugins .Register (testPickerName ,
626
+ plugins .Register (testPickerType ,
627
627
func (name string , parameters json.RawMessage , handle plugins.Handle ) (plugins.Plugin , error ) {
628
628
return & testPicker {}, nil
629
629
},
630
630
)
631
631
632
- plugins .Register (testProfileHandlerName ,
632
+ plugins .Register (testProfileHandlerType ,
633
633
func (name string , parameters json.RawMessage , handle plugins.Handle ) (plugins.Plugin , error ) {
634
634
return & testProfileHandler {}, nil
635
635
},
0 commit comments