1
0
mirror of https://github.com/kubernetes-sigs/descheduler.git synced 2026-01-26 05:14:13 +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:58:33 +01:00
parent c02779b6a5
commit 1a61470e81

View File

@@ -138,11 +138,12 @@ func TestPodLifeTime(t *testing.T) {
pod.ObjectMeta.OwnerReferences = ownerRef1
pod.DeletionTimestamp = &metav1.Time{}
})
p15 := test.BuildTestPod("p15", 100, 0, node1.Name, nil)
p15.Namespace = "dev"
p15.ObjectMeta.CreationTimestamp = olderPodCreationTime
p15.ObjectMeta.OwnerReferences = ownerRef1
p15.DeletionTimestamp = &metav1.Time{}
p15 := test.BuildTestPod("p15", 100, 0, node1.Name, func(pod *v1.Pod) {
pod.Namespace = "dev"
pod.ObjectMeta.CreationTimestamp = olderPodCreationTime
pod.ObjectMeta.OwnerReferences = ownerRef1
pod.DeletionTimestamp = &metav1.Time{}
})
p16 := test.BuildTestPod("p16", 100, 0, node1.Name, nil)
p16.Namespace = "dev"