Merge pull request #8314 from mtrqq/remove-preemption-policy-expendable
Do not consider pod PreemptionPolicy while determining whether pod is expendable
This commit is contained in:
commit
637d9ad908
|
|
@ -64,7 +64,5 @@ func FilterOutExpendablePods(pods []*apiv1.Pod, expendablePodsPriorityCutoff int
|
|||
|
||||
// IsExpendablePod tests if pod is expendable for give priority cutoff
|
||||
func IsExpendablePod(pod *apiv1.Pod, expendablePodsPriorityCutoff int) bool {
|
||||
preemptLowerPriority := pod.Spec.PreemptionPolicy == nil || *pod.Spec.PreemptionPolicy == apiv1.PreemptLowerPriority
|
||||
lowPriority := pod.Spec.Priority != nil && int(*pod.Spec.Priority) < expendablePodsPriorityCutoff
|
||||
return preemptLowerPriority && lowPriority
|
||||
return pod.Spec.Priority != nil && int(*pod.Spec.Priority) < expendablePodsPriorityCutoff
|
||||
}
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ func TestFilterOutExpendablePods(t *testing.T) {
|
|||
assert.Equal(t, podWaitingForPreemption2, res[2])
|
||||
}
|
||||
|
||||
func TestIsExpandablePod(t *testing.T) {
|
||||
func TestIsExpendablePod(t *testing.T) {
|
||||
preemptLowerPriorityPolicy := apiv1.PreemptLowerPriority
|
||||
neverPolicy := apiv1.PreemptNever
|
||||
|
||||
|
|
@ -150,7 +150,7 @@ func TestIsExpandablePod(t *testing.T) {
|
|||
name: "pod priority set, never preemption policy, higher cutoff",
|
||||
pod: withPodPriority(BuildTestPod("p", 0, 0), -1, &neverPolicy),
|
||||
cutoff: 0,
|
||||
want: false,
|
||||
want: true,
|
||||
},
|
||||
{
|
||||
name: "pod priority set, never preemption policy, equal cutoff",
|
||||
|
|
|
|||
Loading…
Reference in New Issue