mirror of https://github.com/k3s-io/k3s
Merge pull request #75507 from hex108/skip
Avoid unnecessary sort for some cases in selectVictimsOnNodek3s-v1.15.3
commit
efaf4f3bdb
|
@ -1070,7 +1070,6 @@ func selectVictimsOnNode(
|
||||||
removePod(p)
|
removePod(p)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
potentialVictims.Sort()
|
|
||||||
// If the new pod does not fit after removing all the lower priority pods,
|
// 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
|
// 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
|
// 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
|
var victims []*v1.Pod
|
||||||
numViolatingVictim := 0
|
numViolatingVictim := 0
|
||||||
|
potentialVictims.Sort()
|
||||||
// Try to reprieve as many pods as possible. We first try to reprieve the PDB
|
// 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
|
// violating victims and then other non-violating ones. In both cases, we start
|
||||||
// from the highest priority victims.
|
// from the highest priority victims.
|
||||||
|
|
Loading…
Reference in New Issue