mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 13:37:30 +00:00
minor cleanup of selector_spreading priority function
This commit is contained in:
parent
cefca66b1f
commit
be55371ff2
@ -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)
|
glog.V(4).Infof("skipping pending-deleted pod: %s/%s", nodePod.Namespace, nodePod.Name)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
matches := false
|
|
||||||
for _, selector := range selectors {
|
for _, selector := range selectors {
|
||||||
if selector.Matches(labels.Set(nodePod.ObjectMeta.Labels)) {
|
if selector.Matches(labels.Set(nodePod.ObjectMeta.Labels)) {
|
||||||
matches = true
|
count++
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if matches {
|
|
||||||
count++
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return schedulerapi.HostPriority{
|
return schedulerapi.HostPriority{
|
||||||
Host: node.Name,
|
Host: node.Name,
|
||||||
|
Loading…
Reference in New Issue
Block a user