mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 20:53:33 +00:00
Merge pull request #18416 from xiang90/r_scheduler
Auto commit by PR queue bot
This commit is contained in:
commit
2c89a8d16d
@ -63,6 +63,9 @@ type genericScheduler struct {
|
||||
randomLock sync.Mutex
|
||||
}
|
||||
|
||||
// Schedule tries to schedule the given pod to one of node in the node list.
|
||||
// If it succeeds, it will return the name of the node.
|
||||
// If it fails, it will return a Fiterror error with reasons.
|
||||
func (g *genericScheduler) Schedule(pod *api.Pod, nodeLister algorithm.NodeLister) (string, error) {
|
||||
nodes, err := nodeLister.List()
|
||||
if err != nil {
|
||||
@ -84,17 +87,18 @@ func (g *genericScheduler) Schedule(pod *api.Pod, nodeLister algorithm.NodeListe
|
||||
return "", err
|
||||
}
|
||||
|
||||
priorityList, err := PrioritizeNodes(pod, machinesToPods, g.pods, g.prioritizers, algorithm.FakeNodeLister(filteredNodes), g.extenders)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
if len(priorityList) == 0 {
|
||||
if len(filteredNodes.Items) == 0 {
|
||||
return "", &FitError{
|
||||
Pod: pod,
|
||||
FailedPredicates: failedPredicateMap,
|
||||
}
|
||||
}
|
||||
|
||||
priorityList, err := PrioritizeNodes(pod, machinesToPods, g.pods, g.prioritizers, algorithm.FakeNodeLister(filteredNodes), g.extenders)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
return g.selectHost(priorityList)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user