diff --git a/pkg/scheduler/framework/runtime/framework.go b/pkg/scheduler/framework/runtime/framework.go index b819e308584..e12ed28c875 100644 --- a/pkg/scheduler/framework/runtime/framework.go +++ b/pkg/scheduler/framework/runtime/framework.go @@ -331,7 +331,10 @@ func NewFramework(r Registry, profile *config.KubeSchedulerProfile, stopCh <-cha } if len(f.queueSortPlugins) != 1 { - return nil, fmt.Errorf("one queue sort plugin required for profile with scheduler name %q", profile.SchedulerName) + return nil, fmt.Errorf("only one queue sort plugin required for profile with scheduler name %q, but got %d", profile.SchedulerName, len(f.queueSortPlugins)) + } + if len(f.bindPlugins) == 0 { + return nil, fmt.Errorf("at least one bind plugin is needed for profile with scheduler name %q", profile.SchedulerName) } if err := getScoreWeights(f, pluginsMap, append(profile.Plugins.Score.Enabled, profile.Plugins.MultiPoint.Enabled...)); err != nil { @@ -346,16 +349,6 @@ func NewFramework(r Registry, profile *config.KubeSchedulerProfile, stopCh <-cha } } - if len(f.queueSortPlugins) == 0 { - return nil, fmt.Errorf("no queue sort plugin is enabled") - } - if len(f.queueSortPlugins) > 1 { - return nil, fmt.Errorf("only one queue sort plugin can be enabled") - } - if len(f.bindPlugins) == 0 { - return nil, fmt.Errorf("at least one bind plugin is needed") - } - if options.captureProfile != nil { if len(outputProfile.PluginConfig) != 0 { sort.Slice(outputProfile.PluginConfig, func(i, j int) bool {