mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 19:31:44 +00:00
Merge pull request #110167 from NoicFank/master
scheduling: fix duplicate checks for number of enabled queue sort plugin
This commit is contained in:
commit
3d5971aa5d
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user