Skip to content

Commit

Permalink
Merge pull request #110167 from NoicFank/master
Browse files Browse the repository at this point in the history
scheduling: fix duplicate checks for number of enabled queue sort plugin
  • Loading branch information
k8s-ci-robot committed Jun 21, 2022
2 parents 1ceca7b + 2499c24 commit 3d5971a
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions pkg/scheduler/framework/runtime/framework.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down

0 comments on commit 3d5971a

Please sign in to comment.