Add MultiPoint scheduler plugin config field

This commit is contained in:
Mike Dame
2021-10-11 13:47:23 -04:00
parent 582c4ebe26
commit 420c5308bb
20 changed files with 873 additions and 344 deletions

View File

@@ -31,10 +31,10 @@ import (
)
var fakeRegistry = frameworkruntime.Registry{
"QueueSort": newFakePlugin,
"Bind1": newFakePlugin,
"Bind2": newFakePlugin,
"Another": newFakePlugin,
"QueueSort": newFakePlugin("QueueSort"),
"Bind1": newFakePlugin("Bind1"),
"Bind2": newFakePlugin("Bind2"),
"Another": newFakePlugin("Another"),
}
func TestNewMap(t *testing.T) {
@@ -260,10 +260,12 @@ func TestNewMap(t *testing.T) {
}
}
type fakePlugin struct{}
type fakePlugin struct {
name string
}
func (p *fakePlugin) Name() string {
return ""
return p.name
}
func (p *fakePlugin) Less(*framework.QueuedPodInfo, *framework.QueuedPodInfo) bool {
@@ -274,8 +276,10 @@ func (p *fakePlugin) Bind(context.Context, *framework.CycleState, *v1.Pod, strin
return nil
}
func newFakePlugin(_ runtime.Object, _ framework.Handle) (framework.Plugin, error) {
return &fakePlugin{}, nil
func newFakePlugin(name string) func(object runtime.Object, handle framework.Handle) (framework.Plugin, error) {
return func(_ runtime.Object, _ framework.Handle) (framework.Plugin, error) {
return &fakePlugin{name: name}, nil
}
}
func nilRecorderFactory(_ string) events.EventRecorder {