Merge pull request #75507 from hex108/skip

Avoid unnecessary sort for some cases in selectVictimsOnNode
k3s-v1.15.3
Kubernetes Prow Robot 2019-03-22 00:04:44 -07:00 committed by GitHub
commit efaf4f3bdb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

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