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

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

This commit is contained in:
Jan Chaloupka
2025-12-10 12:59:59 +01:00
parent 9722018847
commit 0c80f3689d

View File

@@ -47,10 +47,11 @@ func TestPodLifeTime(t *testing.T) {
pod.ObjectMeta.CreationTimestamp = newerPodCreationTime
pod.ObjectMeta.OwnerReferences = ownerRef1
})
p2 := test.BuildTestPod("p2", 100, 0, node1.Name, nil)
p2.Namespace = "dev"
p2.ObjectMeta.CreationTimestamp = olderPodCreationTime
p2.ObjectMeta.OwnerReferences = ownerRef1
p2 := test.BuildTestPod("p2", 100, 0, node1.Name, func(pod *v1.Pod) {
pod.Namespace = "dev"
pod.ObjectMeta.CreationTimestamp = olderPodCreationTime
pod.ObjectMeta.OwnerReferences = ownerRef1
})
// Setup pods, zero should be evicted
p3 := test.BuildTestPod("p3", 100, 0, node1.Name, nil)