Skip to content

Commit c1112eb

Browse files
committed
Fixed merge and lint issue
2 parents c3ab802 + 922d47a commit c1112eb

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

pkg/epp/scheduling/plugins/picker/max-score.go

+6-5
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package picker
33
import (
44
"fmt"
55

6+
"sigs.k8s.io/gateway-api-inference-extension/pkg/epp/scheduling/plugins"
67
"sigs.k8s.io/gateway-api-inference-extension/pkg/epp/scheduling/types"
78
logutil "sigs.k8s.io/gateway-api-inference-extension/pkg/epp/util/logging"
89
)
@@ -11,15 +12,15 @@ import (
1112
// candidates.
1213
type MaxScorePicker struct{}
1314

14-
//var _ types.Picker = &MaxScorePicker{}
15+
var _ plugins.Picker = &MaxScorePicker{}
1516

1617
// Name returns the name of the picker.
1718
func (msp *MaxScorePicker) Name() string {
1819
return "max-score"
1920
}
2021

2122
// Pick selects the pod with the maximum score from the list of candidates.
22-
func (msp *MaxScorePicker) Pick(ctx *types.SchedulingContext, pods []types.Pod) (*types.Result, error) {
23+
func (msp *MaxScorePicker) Pick(ctx *types.SchedulingContext, pods []types.Pod) *types.Result {
2324
debugLogger := ctx.Logger.V(logutil.DEBUG).WithName("max-score-picker")
2425
debugLogger.Info(fmt.Sprintf("Selecting the pod with the max score from %d candidates: %+v",
2526
len(pods), pods))
@@ -38,17 +39,17 @@ func (msp *MaxScorePicker) Pick(ctx *types.SchedulingContext, pods []types.Pod)
3839
}
3940

4041
if len(winners) == 0 {
41-
return nil, nil
42+
return nil
4243
}
4344

4445
if len(winners) > 1 {
4546
debugLogger.Info(fmt.Sprintf("Multiple pods have the same max score (%f): %+v",
4647
maxScore, winners))
4748

4849
randomPicker := RandomPicker{}
49-
return randomPicker.Pick(ctx, winners), nil
50+
return randomPicker.Pick(ctx, winners)
5051
}
5152

5253
debugLogger.Info(fmt.Sprintf("Selected pod with max score (%f): %+v", maxScore, winners[0]))
53-
return &types.Result{TargetPod: winners[0]}, nil
54+
return &types.Result{TargetPod: winners[0]}
5455
}

0 commit comments

Comments
 (0)