Skip to content

Commit 846a7cf

Browse files
committed
Cleanup of old configuration loading code
Signed-off-by: Shmuel Kallner <kallner@il.ibm.com>
1 parent 0da7c51 commit 846a7cf

File tree

2 files changed

+0
-303
lines changed

2 files changed

+0
-303
lines changed

pkg/epp/scheduling/scheduler_config.go

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,6 @@ limitations under the License.
1717
package scheduling
1818

1919
import (
20-
"errors"
21-
"fmt"
22-
23-
"sigs.k8s.io/gateway-api-inference-extension/api/config/v1alpha1"
24-
"sigs.k8s.io/gateway-api-inference-extension/pkg/epp/plugins"
2520
"sigs.k8s.io/gateway-api-inference-extension/pkg/epp/scheduling/framework"
2621
)
2722

@@ -38,46 +33,3 @@ type SchedulerConfig struct {
3833
profileHandler framework.ProfileHandler
3934
profiles map[string]*framework.SchedulerProfile
4035
}
41-
42-
func LoadSchedulerConfig(configProfiles []v1alpha1.SchedulingProfile, references map[string]plugins.Plugin) (*SchedulerConfig, error) {
43-
44-
var profiles = map[string]*framework.SchedulerProfile{}
45-
46-
for _, configProfile := range configProfiles {
47-
profile := framework.SchedulerProfile{}
48-
49-
for _, plugin := range configProfile.Plugins {
50-
var err error
51-
thePlugin := references[plugin.PluginRef]
52-
if theScorer, ok := thePlugin.(framework.Scorer); ok {
53-
if plugin.Weight == nil {
54-
return nil, fmt.Errorf("scorer '%s' is missing a weight", plugin.PluginRef)
55-
}
56-
thePlugin = framework.NewWeightedScorer(theScorer, *plugin.Weight)
57-
}
58-
err = profile.AddPlugins(thePlugin)
59-
if err != nil {
60-
return nil, err
61-
}
62-
}
63-
profiles[configProfile.Name] = &profile
64-
}
65-
66-
var profileHandler framework.ProfileHandler
67-
var profileHandlerName string
68-
69-
for pluginName, thePlugin := range references {
70-
if theProfileHandler, ok := thePlugin.(framework.ProfileHandler); ok {
71-
if profileHandler != nil {
72-
return nil, fmt.Errorf("only one profile handler is allowed. Both %s and %s are profile handlers", profileHandlerName, pluginName)
73-
}
74-
profileHandler = theProfileHandler
75-
profileHandlerName = pluginName
76-
}
77-
}
78-
if profileHandler == nil {
79-
return nil, errors.New("no profile handler was specified")
80-
}
81-
82-
return NewSchedulerConfig(profileHandler, profiles), nil
83-
}

pkg/epp/scheduling/scheduler_config_test.go

Lines changed: 0 additions & 255 deletions
This file was deleted.

0 commit comments

Comments
 (0)