Skip to content

Commit

Permalink
Merge pull request kubernetes#52637 from stewart-yu/issue#06
Browse files Browse the repository at this point in the history
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
```
  • Loading branch information
Kubernetes Submit Queue authored Oct 16, 2017
2 parents 77b83e4 + 5937184 commit 1ab5075
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions plugin/pkg/scheduler/core/generic_scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,12 @@ func (g *genericScheduler) Schedule(pod *v1.Pod, nodeLister algorithm.NodeLister
}

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)
priorityList, err := PrioritizeNodes(pod, g.cachedNodeInfoMap, metaPrioritiesInterface, g.prioritizers, filteredNodes, g.extenders)
if err != nil {
Expand Down

0 comments on commit 1ab5075

Please sign in to comment.