Merge pull request #66625 from bsalamat/sched_cleanup

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>.

minor cleanup of selector_spreading priority function

**What this PR does / why we need it**:
Just a minor cleanup

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```

/sig scheudling
This commit is contained in:
Kubernetes Submit Queue 2018-07-25 22:58:43 -07:00 committed by GitHub
commit 85b8a23f19
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -97,16 +97,12 @@ func (s *SelectorSpread) CalculateSpreadPriorityMap(pod *v1.Pod, meta interface{
glog.V(4).Infof("skipping pending-deleted pod: %s/%s", nodePod.Namespace, nodePod.Name)
continue
}
matches := false
for _, selector := range selectors {
if selector.Matches(labels.Set(nodePod.ObjectMeta.Labels)) {
matches = true
count++
break
}
}
if matches {
count++
}
}
return schedulerapi.HostPriority{
Host: node.Name,