mirror of https://github.com/k3s-io/k3s
Merge pull request #52637 from stewart-yu/issue#06
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Modify Schedule function **What this PR does / why we need it**: It is obvious that no need to prioritizing when only one node after predicate. **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes # **Special notes for your reviewer**: @davidopp @timothysc **Release note**: ```release-note NONE ```pull/6/head
commit
1ab5075c7c
|
@ -129,6 +129,12 @@ func (g *genericScheduler) Schedule(pod *v1.Pod, nodeLister algorithm.NodeLister
|
||||||
}
|
}
|
||||||
|
|
||||||
trace.Step("Prioritizing")
|
trace.Step("Prioritizing")
|
||||||
|
|
||||||
|
// When only one node after predicate, just use it.
|
||||||
|
if len(filteredNodes) == 1 {
|
||||||
|
return filteredNodes[0].Name, nil
|
||||||
|
}
|
||||||
|
|
||||||
metaPrioritiesInterface := g.priorityMetaProducer(pod, g.cachedNodeInfoMap)
|
metaPrioritiesInterface := g.priorityMetaProducer(pod, g.cachedNodeInfoMap)
|
||||||
priorityList, err := PrioritizeNodes(pod, g.cachedNodeInfoMap, metaPrioritiesInterface, g.prioritizers, filteredNodes, g.extenders)
|
priorityList, err := PrioritizeNodes(pod, g.cachedNodeInfoMap, metaPrioritiesInterface, g.prioritizers, filteredNodes, g.extenders)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue