make runtime.NewFramework accept KubeSchedulerProfile

This commit is contained in:
Mengxue Zhang
2021-03-03 21:44:25 +00:00
parent 76f2a4d5fd
commit b38caa91cc
23 changed files with 112 additions and 84 deletions

View File

@@ -23,13 +23,17 @@ import (
)
// NewFramework creates a Framework from the register functions and options.
func NewFramework(fns []RegisterPluginFunc, opts ...runtime.Option) (framework.Framework, error) {
func NewFramework(fns []RegisterPluginFunc, profileName string, opts ...runtime.Option) (framework.Framework, error) {
registry := runtime.Registry{}
plugins := &schedulerapi.Plugins{}
for _, f := range fns {
f(&registry, plugins)
}
return runtime.NewFramework(registry, plugins, nil, opts...)
profile := &schedulerapi.KubeSchedulerProfile{
SchedulerName: profileName,
Plugins: plugins,
}
return runtime.NewFramework(registry, profile, opts...)
}
// RegisterPluginFunc is a function signature used in method RegisterFilterPlugin()