Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion pkg/epp/config/loader/configloader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,11 @@ func TestLoadConfig(t *testing.T) {
configText: successWithNoProfileHandlersText,
wantErr: false,
},
{
name: "successPickerWeightUnsetScorerText",
configText: successPickerWeightUnsetScorerText,
wantErr: false,
},
{
name: "errorBadYaml",
configText: errorBadYamlText,
Expand Down Expand Up @@ -472,7 +477,7 @@ func TestLoadConfig(t *testing.T) {
t.Errorf("LoadConfigPhaseOne returned an unexpected error. error %v", err)
}
t.Logf("error was %s", err)
} else if test.wantErr {
} else {
handle := utils.NewTestHandle(context.Background())
_, err = LoadConfigPhaseTwo(rawConfig, handle, logger)
if err != nil {
Expand Down Expand Up @@ -945,6 +950,22 @@ schedulingProfiles:
- pluginRef: maxScore
`

// success with picker and unset weight scorer
//
//nolint:dupword
const successPickerWeightUnsetScorerText = `
apiVersion: inference.networking.x-k8s.io/v1alpha1
kind: EndpointPickerConfig
plugins:
- type: random-picker
- type: prefix-cache-scorer
schedulingProfiles:
- name: default
plugins:
- pluginRef: random-picker
- pluginRef: prefix-cache-scorer
`

// invalid parameter configuration for plugin (string passed, in expected)
//
//nolint:dupword
Expand Down
1 change: 0 additions & 1 deletion pkg/epp/config/loader/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ func setDefaultsPhaseTwo(cfg *configapi.EndpointPickerConfig, handle plugins.Han
cfg.SchedulingProfiles[idx] = theProfile
} else if _, ok := referencedPlugin.(framework.Picker); ok {
hasPicker = true
break
}
}
if !hasPicker {
Expand Down