mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-04 15:05:20 +00:00
Avoid copying nodes in priority functions
This commit is contained in:
@@ -83,7 +83,8 @@ func (s *NodeAffinity) CalculateNodeAffinityPriority(pod *api.Pod, nodeNameToInf
|
||||
}
|
||||
|
||||
result := []schedulerapi.HostPriority{}
|
||||
for _, node := range nodes.Items {
|
||||
for i := range nodes.Items {
|
||||
node := &nodes.Items[i]
|
||||
fScore := float64(0)
|
||||
if maxCount > 0 {
|
||||
fScore = 10 * (float64(counts[node.Name]) / float64(maxCount))
|
||||
|
||||
Reference in New Issue
Block a user