Unverified Commit efaf4f3b authored by Kubernetes Prow Robot's avatar Kubernetes Prow Robot Committed by GitHub

Merge pull request #75507 from hex108/skip

Avoid unnecessary sort for some cases in selectVictimsOnNode
parents dfe2e0e7 27553734
......@@ -1070,7 +1070,6 @@ func selectVictimsOnNode(
removePod(p)
}
}
potentialVictims.Sort()
// If the new pod does not fit after removing all the lower priority pods,
// we are almost done and this node is not suitable for preemption. The only
// condition that we could check is if the "pod" is failing to schedule due to
......@@ -1085,6 +1084,7 @@ func selectVictimsOnNode(
}
var victims []*v1.Pod
numViolatingVictim := 0
potentialVictims.Sort()
// Try to reprieve as many pods as possible. We first try to reprieve the PDB
// violating victims and then other non-violating ones. In both cases, we start
// from the highest priority victims.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment