Skip to content

Commit 54c73a6

Browse files
authored
Add local_config.go which adds custom plugins (#86)
* Add local_config.go which updates default config with custom plugins * Fix load-base scorer in local config
1 parent 5918deb commit 54c73a6

File tree

2 files changed

+25
-5
lines changed

2 files changed

+25
-5
lines changed

pkg/epp/scheduling/local_config.go

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
Copyright 2025 The Kubernetes Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package scheduling
18+
19+
import (
20+
"sigs.k8s.io/gateway-api-inference-extension/pkg/epp/scheduling/plugins/scorers"
21+
)
22+
23+
func init() {
24+
defaultConfig.scorers[&scorers.LoadBasedScorer{}] = 1.0
25+
}

pkg/epp/scheduling/plugins/scorers/load_based_scorer.go

-5
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,11 @@ package scorers
1717

1818
import (
1919
"sigs.k8s.io/gateway-api-inference-extension/pkg/epp/scheduling/config"
20-
"sigs.k8s.io/gateway-api-inference-extension/pkg/epp/scheduling/plugins"
2120
"sigs.k8s.io/gateway-api-inference-extension/pkg/epp/scheduling/types"
2221
)
2322

2423
type LoadBasedScorer struct{}
2524

26-
func NewLoadBasedScorer() plugins.Scorer {
27-
return LoadBasedScorer{}
28-
}
29-
3025
func (s LoadBasedScorer) Name() string {
3126
return "load based scorer"
3227
}

0 commit comments

Comments
 (0)