mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 04:33:26 +00:00
make sure filters are executed when no predicates configured
This commit is contained in:
parent
f7091992c0
commit
17a6a7914c
@ -458,7 +458,7 @@ func (g *genericScheduler) findNodesThatFit(state *framework.CycleState, pod *v1
|
|||||||
failedPredicateMap := FailedPredicateMap{}
|
failedPredicateMap := FailedPredicateMap{}
|
||||||
filteredNodesStatuses := framework.NodeToStatusMap{}
|
filteredNodesStatuses := framework.NodeToStatusMap{}
|
||||||
|
|
||||||
if len(g.predicates) == 0 {
|
if len(g.predicates) == 0 && !g.framework.HasFilterPlugins() {
|
||||||
filtered = g.nodeInfoSnapshot.ListNodes()
|
filtered = g.nodeInfoSnapshot.ListNodes()
|
||||||
} else {
|
} else {
|
||||||
allNodes := int32(g.cache.NodeTree().NumNodes())
|
allNodes := int32(g.cache.NodeTree().NumNodes())
|
||||||
|
@ -599,6 +599,11 @@ func (f *framework) GetWaitingPod(uid types.UID) WaitingPod {
|
|||||||
return f.waitingPods.get(uid)
|
return f.waitingPods.get(uid)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// HasFilterPlugins returns true if at least one filter plugin is defined.
|
||||||
|
func (f *framework) HasFilterPlugins() bool {
|
||||||
|
return len(f.filterPlugins) > 0
|
||||||
|
}
|
||||||
|
|
||||||
// ListPlugins returns a map of extension point name to plugin names configured at each extension
|
// ListPlugins returns a map of extension point name to plugin names configured at each extension
|
||||||
// point. Returns nil if no plugins where configred.
|
// point. Returns nil if no plugins where configred.
|
||||||
func (f *framework) ListPlugins() map[string][]config.Plugin {
|
func (f *framework) ListPlugins() map[string][]config.Plugin {
|
||||||
|
@ -435,6 +435,9 @@ type Framework interface {
|
|||||||
// code=4("skip") status.
|
// code=4("skip") status.
|
||||||
RunBindPlugins(state *CycleState, pod *v1.Pod, nodeName string) *Status
|
RunBindPlugins(state *CycleState, pod *v1.Pod, nodeName string) *Status
|
||||||
|
|
||||||
|
// HasFilterPlugins return true if at least one filter plugin is defined
|
||||||
|
HasFilterPlugins() bool
|
||||||
|
|
||||||
// ListPlugins returns a map of extension point name to list of configured Plugins.
|
// ListPlugins returns a map of extension point name to list of configured Plugins.
|
||||||
ListPlugins() map[string][]config.Plugin
|
ListPlugins() map[string][]config.Plugin
|
||||||
}
|
}
|
||||||
|
@ -172,6 +172,10 @@ func (*fakeFramework) QueueSortFunc() framework.LessFunc {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (f *fakeFramework) HasFilterPlugins() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
func (f *fakeFramework) ListPlugins() map[string][]config.Plugin {
|
func (f *fakeFramework) ListPlugins() map[string][]config.Plugin {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user