1
0
mirror of https://github.com/kubernetes-sigs/descheduler.git synced 2026-01-26 21:31:18 +01:00

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

This commit is contained in:
Jan Chaloupka
2025-12-10 13:03:31 +01:00
parent 31af0d8223
commit 6ffc7e3975

View File

@@ -61,10 +61,11 @@ func TestPodLifeTime(t *testing.T) {
pod.ObjectMeta.CreationTimestamp = newerPodCreationTime
pod.ObjectMeta.OwnerReferences = ownerRef2
})
p4 := test.BuildTestPod("p4", 100, 0, node1.Name, nil)
p4.Namespace = "dev"
p4.ObjectMeta.CreationTimestamp = newerPodCreationTime
p4.ObjectMeta.OwnerReferences = ownerRef2
p4 := test.BuildTestPod("p4", 100, 0, node1.Name, func(pod *v1.Pod) {
pod.Namespace = "dev"
pod.ObjectMeta.CreationTimestamp = newerPodCreationTime
pod.ObjectMeta.OwnerReferences = ownerRef2
})
// Setup pods, one should be evicted
p5 := test.BuildTestPod("p5", 100, 0, node1.Name, nil)