mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 20:24:09 +00:00
Merge pull request #84506 from hex108/run_score_plugin
Make sure score plugins are executed when no prioritizer configured
This commit is contained in:
commit
f75ef82ece
@ -713,7 +713,7 @@ func PrioritizeNodes(
|
||||
state *framework.CycleState) (framework.NodeScoreList, error) {
|
||||
// If no priority configs are provided, then the EqualPriority function is applied
|
||||
// This is required to generate the priority list in the required format
|
||||
if len(priorityConfigs) == 0 && len(extenders) == 0 {
|
||||
if len(priorityConfigs) == 0 && len(extenders) == 0 && !fwk.HasScorePlugins() {
|
||||
result := make(framework.NodeScoreList, 0, len(nodes))
|
||||
for i := range nodes {
|
||||
hostPriority, err := EqualPriorityMap(pod, meta, nodeNameToInfo[nodes[i].Name])
|
||||
|
@ -635,6 +635,11 @@ func (f *framework) HasFilterPlugins() bool {
|
||||
return len(f.filterPlugins) > 0
|
||||
}
|
||||
|
||||
// HasScorePlugins returns true if at least one score plugin is defined.
|
||||
func (f *framework) HasScorePlugins() bool {
|
||||
return len(f.scorePlugins) > 0
|
||||
}
|
||||
|
||||
// ListPlugins returns a map of extension point name to plugin names configured at each extension
|
||||
// point. Returns nil if no plugins where configred.
|
||||
func (f *framework) ListPlugins() map[string][]config.Plugin {
|
||||
|
@ -442,9 +442,12 @@ type Framework interface {
|
||||
// code=4("skip") status.
|
||||
RunBindPlugins(ctx context.Context, state *CycleState, pod *v1.Pod, nodeName string) *Status
|
||||
|
||||
// HasFilterPlugins return true if at least one filter plugin is defined
|
||||
// HasFilterPlugins returns true if at least one filter plugin is defined.
|
||||
HasFilterPlugins() bool
|
||||
|
||||
// HasScorePlugins returns true if at least one score plugin is defined.
|
||||
HasScorePlugins() bool
|
||||
|
||||
// ListPlugins returns a map of extension point name to list of configured Plugins.
|
||||
ListPlugins() map[string][]config.Plugin
|
||||
}
|
||||
|
@ -179,6 +179,10 @@ func (f *fakeFramework) HasFilterPlugins() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func (f *fakeFramework) HasScorePlugins() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func (f *fakeFramework) ListPlugins() map[string][]config.Plugin {
|
||||
return nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user