1
0
mirror of https://github.com/kubernetes-sigs/descheduler.git synced 2026-01-26 05:14:13 +01:00

Drop assignment if default test values

This commit is contained in:
Jan Chaloupka
2025-07-23 10:31:14 +02:00
parent bf6a51f733
commit 5cc9e68127

View File

@@ -90,10 +90,7 @@ func TestDefaultEvictorPreEvictionFilter(t *testing.T) {
}
}),
},
evictLocalStoragePods: false,
evictSystemCriticalPods: false,
nodeFit: true,
result: false,
}, {
description: "Pod with correct tolerations running on normal node, all other nodes tainted",
pods: []*v1.Pod{
@@ -128,8 +125,6 @@ func TestDefaultEvictorPreEvictionFilter(t *testing.T) {
}
}),
},
evictLocalStoragePods: false,
evictSystemCriticalPods: false,
nodeFit: true,
result: true,
}, {
@@ -154,10 +149,7 @@ func TestDefaultEvictorPreEvictionFilter(t *testing.T) {
}
}),
},
evictLocalStoragePods: false,
evictSystemCriticalPods: false,
nodeFit: true,
result: false,
}, {
description: "Pod with correct node selector",
pods: []*v1.Pod{
@@ -180,8 +172,6 @@ func TestDefaultEvictorPreEvictionFilter(t *testing.T) {
}
}),
},
evictLocalStoragePods: false,
evictSystemCriticalPods: false,
nodeFit: true,
result: true,
}, {
@@ -206,10 +196,7 @@ func TestDefaultEvictorPreEvictionFilter(t *testing.T) {
}
}),
},
evictLocalStoragePods: false,
evictSystemCriticalPods: false,
nodeFit: true,
result: false,
}, {
description: "Pod with correct node selector, and one node has enough memory",
pods: []*v1.Pod{
@@ -242,8 +229,6 @@ func TestDefaultEvictorPreEvictionFilter(t *testing.T) {
}
}),
},
evictLocalStoragePods: false,
evictSystemCriticalPods: false,
nodeFit: true,
result: true,
}, {
@@ -278,10 +263,7 @@ func TestDefaultEvictorPreEvictionFilter(t *testing.T) {
}
}),
},
evictLocalStoragePods: false,
evictSystemCriticalPods: false,
nodeFit: true,
result: false,
}, {
description: "Pod with incorrect node selector, but nodefit false, should still be evicted",
pods: []*v1.Pod{
@@ -304,9 +286,6 @@ func TestDefaultEvictorPreEvictionFilter(t *testing.T) {
}
}),
},
evictLocalStoragePods: false,
evictSystemCriticalPods: false,
nodeFit: false,
result: true,
},
}
@@ -349,13 +328,10 @@ func TestDefaultEvictorFilter(t *testing.T) {
pod.Status.Phase = v1.PodFailed
}),
},
evictFailedBarePods: false,
result: false,
}, {
description: "Normal pod eviction with no ownerRefs and evictFailedBarePods enabled",
pods: []*v1.Pod{test.BuildTestPod("bare_pod", 400, 0, n1.Name, nil)},
evictFailedBarePods: true,
result: false,
}, {
description: "Failed pod eviction with no ownerRefs",
pods: []*v1.Pod{
@@ -372,8 +348,6 @@ func TestDefaultEvictorFilter(t *testing.T) {
pod.ObjectMeta.OwnerReferences = test.GetNormalPodOwnerRefList()
}),
},
evictLocalStoragePods: false,
evictSystemCriticalPods: false,
result: true,
}, {
description: "Normal pod eviction with normal ownerRefs and descheduler.alpha.kubernetes.io/evict annotation",
@@ -383,8 +357,6 @@ func TestDefaultEvictorFilter(t *testing.T) {
pod.ObjectMeta.OwnerReferences = test.GetNormalPodOwnerRefList()
}),
},
evictLocalStoragePods: false,
evictSystemCriticalPods: false,
result: true,
}, {
description: "Normal pod eviction with replicaSet ownerRefs",
@@ -393,8 +365,6 @@ func TestDefaultEvictorFilter(t *testing.T) {
pod.ObjectMeta.OwnerReferences = test.GetNormalPodOwnerRefList()
}),
},
evictLocalStoragePods: false,
evictSystemCriticalPods: false,
result: true,
}, {
description: "Normal pod eviction with replicaSet ownerRefs and descheduler.alpha.kubernetes.io/evict annotation",
@@ -404,8 +374,6 @@ func TestDefaultEvictorFilter(t *testing.T) {
pod.ObjectMeta.OwnerReferences = test.GetReplicaSetOwnerRefList()
}),
},
evictLocalStoragePods: false,
evictSystemCriticalPods: false,
result: true,
}, {
description: "Normal pod eviction with statefulSet ownerRefs",
@@ -414,8 +382,6 @@ func TestDefaultEvictorFilter(t *testing.T) {
pod.ObjectMeta.OwnerReferences = test.GetNormalPodOwnerRefList()
}),
},
evictLocalStoragePods: false,
evictSystemCriticalPods: false,
result: true,
}, {
description: "Normal pod eviction with statefulSet ownerRefs and descheduler.alpha.kubernetes.io/evict annotation",
@@ -425,8 +391,6 @@ func TestDefaultEvictorFilter(t *testing.T) {
pod.ObjectMeta.OwnerReferences = test.GetStatefulSetOwnerRefList()
}),
},
evictLocalStoragePods: false,
evictSystemCriticalPods: false,
result: true,
}, {
description: "Pod not evicted because it is bound to a PV and evictLocalStoragePods = false",
@@ -446,9 +410,6 @@ func TestDefaultEvictorFilter(t *testing.T) {
}
}),
},
evictLocalStoragePods: false,
evictSystemCriticalPods: false,
result: false,
}, {
description: "Pod is evicted because it is bound to a PV and evictLocalStoragePods = true",
pods: []*v1.Pod{
@@ -468,7 +429,6 @@ func TestDefaultEvictorFilter(t *testing.T) {
}),
},
evictLocalStoragePods: true,
evictSystemCriticalPods: false,
result: true,
}, {
description: "Pod is evicted because it is bound to a PV and evictLocalStoragePods = false, but it has scheduler.alpha.kubernetes.io/evict annotation",
@@ -489,8 +449,6 @@ func TestDefaultEvictorFilter(t *testing.T) {
}
}),
},
evictLocalStoragePods: false,
evictSystemCriticalPods: false,
result: true,
}, {
description: "Pod not evicted because it is part of a daemonSet",
@@ -500,9 +458,6 @@ func TestDefaultEvictorFilter(t *testing.T) {
pod.ObjectMeta.OwnerReferences = test.GetDaemonSetOwnerRefList()
}),
},
evictLocalStoragePods: false,
evictSystemCriticalPods: false,
result: false,
}, {
description: "Pod is evicted because it is part of a daemonSet, but it has scheduler.alpha.kubernetes.io/evict annotation",
pods: []*v1.Pod{
@@ -511,8 +466,6 @@ func TestDefaultEvictorFilter(t *testing.T) {
pod.ObjectMeta.OwnerReferences = test.GetDaemonSetOwnerRefList()
}),
},
evictLocalStoragePods: false,
evictSystemCriticalPods: false,
result: true,
}, {
description: "Pod not evicted because it is a mirror poddsa",
@@ -522,9 +475,6 @@ func TestDefaultEvictorFilter(t *testing.T) {
pod.Annotations = test.GetMirrorPodAnnotation()
}),
},
evictLocalStoragePods: false,
evictSystemCriticalPods: false,
result: false,
}, {
description: "Pod is evicted because it is a mirror pod, but it has scheduler.alpha.kubernetes.io/evict annotation",
pods: []*v1.Pod{
@@ -534,8 +484,6 @@ func TestDefaultEvictorFilter(t *testing.T) {
pod.Annotations["descheduler.alpha.kubernetes.io/evict"] = "true"
}),
},
evictLocalStoragePods: false,
evictSystemCriticalPods: false,
result: true,
}, {
description: "Pod not evicted because it has system critical priority",
@@ -546,9 +494,6 @@ func TestDefaultEvictorFilter(t *testing.T) {
pod.Spec.Priority = &priority
}),
},
evictLocalStoragePods: false,
evictSystemCriticalPods: false,
result: false,
}, {
description: "Pod is evicted because it has system critical priority, but it has scheduler.alpha.kubernetes.io/evict annotation",
pods: []*v1.Pod{
@@ -561,8 +506,6 @@ func TestDefaultEvictorFilter(t *testing.T) {
}
}),
},
evictLocalStoragePods: false,
evictSystemCriticalPods: false,
result: true,
}, {
description: "Pod not evicted because it has a priority higher than the configured priority threshold",
@@ -572,10 +515,7 @@ func TestDefaultEvictorFilter(t *testing.T) {
pod.Spec.Priority = &highPriority
}),
},
evictLocalStoragePods: false,
evictSystemCriticalPods: false,
priorityThreshold: &lowPriority,
result: false,
}, {
description: "Pod is evicted because it has a priority higher than the configured priority threshold, but it has scheduler.alpha.kubernetes.io/evict annotation",
pods: []*v1.Pod{
@@ -585,8 +525,6 @@ func TestDefaultEvictorFilter(t *testing.T) {
pod.Spec.Priority = &highPriority
}),
},
evictLocalStoragePods: false,
evictSystemCriticalPods: false,
priorityThreshold: &lowPriority,
result: true,
}, {
@@ -598,7 +536,6 @@ func TestDefaultEvictorFilter(t *testing.T) {
pod.Spec.Priority = &priority
}),
},
evictLocalStoragePods: false,
evictSystemCriticalPods: true,
result: true,
}, {
@@ -611,7 +548,6 @@ func TestDefaultEvictorFilter(t *testing.T) {
pod.Spec.Priority = &priority
}),
},
evictLocalStoragePods: false,
evictSystemCriticalPods: true,
result: true,
}, {
@@ -622,7 +558,6 @@ func TestDefaultEvictorFilter(t *testing.T) {
pod.Spec.Priority = &highPriority
}),
},
evictLocalStoragePods: false,
evictSystemCriticalPods: true,
priorityThreshold: &lowPriority,
result: true,
@@ -635,7 +570,6 @@ func TestDefaultEvictorFilter(t *testing.T) {
pod.Spec.Priority = &highPriority
}),
},
evictLocalStoragePods: false,
evictSystemCriticalPods: true,
priorityThreshold: &lowPriority,
result: true,
@@ -666,8 +600,6 @@ func TestDefaultEvictorFilter(t *testing.T) {
}
}),
},
evictLocalStoragePods: false,
evictSystemCriticalPods: false,
nodeFit: true,
result: true,
}, {
@@ -697,7 +629,6 @@ func TestDefaultEvictorFilter(t *testing.T) {
}),
},
minReplicas: 3,
result: false,
}, {
description: "minReplicas of 2, multiple owners, no eviction",
pods: []*v1.Pod{
@@ -721,7 +652,6 @@ func TestDefaultEvictorFilter(t *testing.T) {
}),
},
minPodAge: &minPodAge,
result: false,
}, {
description: "minPodAge of 50, pod created 60 minutes ago, evicts",
pods: []*v1.Pod{
@@ -754,7 +684,6 @@ func TestDefaultEvictorFilter(t *testing.T) {
}),
},
ignorePodsWithoutPDB: true,
result: false,
}, {
description: "ignorePodsWithoutPDB, pod with PDBs, evicts",
pods: []*v1.Pod{
@@ -785,7 +714,6 @@ func TestDefaultEvictorFilter(t *testing.T) {
}),
},
ignorePvcPods: true,
result: false,
}, {
description: "ignorePvcPods is not set, pod with PVC, evicts",
pods: []*v1.Pod{
@@ -800,7 +728,6 @@ func TestDefaultEvictorFilter(t *testing.T) {
}
}),
},
ignorePvcPods: false,
result: true,
},
}