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 14:00:12 +01:00
parent 1a61470e81
commit 16b9311e9e

View File

@@ -145,11 +145,12 @@ func TestPodLifeTime(t *testing.T) {
pod.DeletionTimestamp = &metav1.Time{}
})
p16 := test.BuildTestPod("p16", 100, 0, node1.Name, nil)
p16.Namespace = "dev"
p16.ObjectMeta.CreationTimestamp = olderPodCreationTime
p16.Status.Phase = v1.PodUnknown
p16.ObjectMeta.OwnerReferences = ownerRef1
p16 := test.BuildTestPod("p16", 100, 0, node1.Name, func(pod *v1.Pod) {
pod.Namespace = "dev"
pod.ObjectMeta.CreationTimestamp = olderPodCreationTime
pod.Status.Phase = v1.PodUnknown
pod.ObjectMeta.OwnerReferences = ownerRef1
})
var maxLifeTime uint = 600
testCases := []struct {