diff --git a/pkg/scheduler/core/generic_scheduler.go b/pkg/scheduler/core/generic_scheduler.go index 8875192db7f..a43046c5772 100644 --- a/pkg/scheduler/core/generic_scheduler.go +++ b/pkg/scheduler/core/generic_scheduler.go @@ -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.