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 13:51:42 +01:00
parent cece2ee3cc
commit ee40f7ff30

View File

@@ -98,11 +98,12 @@ func TestPodLifeTime(t *testing.T) {
pod.Status.Phase = "Pending"
pod.ObjectMeta.OwnerReferences = ownerRef1
})
p10 := test.BuildTestPod("p10", 100, 0, node1.Name, nil)
p10.Namespace = "dev"
p10.ObjectMeta.CreationTimestamp = olderPodCreationTime
p10.Status.Phase = "Running"
p10.ObjectMeta.OwnerReferences = ownerRef1
p10 := test.BuildTestPod("p10", 100, 0, node1.Name, func(pod *v1.Pod) {
pod.Namespace = "dev"
pod.ObjectMeta.CreationTimestamp = olderPodCreationTime
pod.Status.Phase = "Running"
pod.ObjectMeta.OwnerReferences = ownerRef1
})
p11 := test.BuildTestPod("p11", 100, 0, node1.Name, func(pod *v1.Pod) {
pod.Spec.Volumes = []v1.Volume{