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

refactor(TestFindDuplicatePods): have a pod fully created through BuildTestPod without any edits

This commit is contained in:
Jan Chaloupka
2025-12-14 12:26:53 +01:00
parent 96171413ba
commit 3d4263bf5e

View File

@@ -81,7 +81,10 @@ func TestFindDuplicatePods(t *testing.T) {
pod.Namespace = "dev"
pod.ObjectMeta.OwnerReferences = ownerRef1
})
p4 := test.BuildTestPod("p4", 100, 0, node1.Name, nil)
// A DaemonSet.
p4 := test.BuildTestPod("p4", 100, 0, node1.Name, func(pod *v1.Pod) {
pod.ObjectMeta.OwnerReferences = test.GetDaemonSetOwnerRefList()
})
p5 := test.BuildTestPod("p5", 100, 0, node1.Name, nil)
p6 := test.BuildTestPod("p6", 100, 0, node1.Name, nil)
p7 := test.BuildTestPod("p7", 100, 0, node1.Name, nil)
@@ -127,9 +130,6 @@ func TestFindDuplicatePods(t *testing.T) {
// ### Non-evictable Pods ###
// A DaemonSet.
p4.ObjectMeta.OwnerReferences = test.GetDaemonSetOwnerRefList()
// A Pod with local storage.
p5.ObjectMeta.OwnerReferences = test.GetNormalPodOwnerRefList()
p5.Spec.Volumes = []v1.Volume{