1
0
mirror of https://github.com/kubernetes-sigs/descheduler.git synced 2026-01-25 20:59:28 +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:56:05 +01:00
parent 34540c3c95
commit ff6363692c

View File

@@ -125,11 +125,12 @@ func TestPodLifeTime(t *testing.T) {
pod.ObjectMeta.Labels = map[string]string{"foo": "bar"}
pod.ObjectMeta.OwnerReferences = ownerRef1
})
p13 := test.BuildTestPod("p13", 100, 0, node1.Name, nil)
p13.Namespace = "dev"
p13.ObjectMeta.CreationTimestamp = olderPodCreationTime
p13.ObjectMeta.Labels = map[string]string{"foo": "bar1"}
p13.ObjectMeta.OwnerReferences = ownerRef1
p13 := test.BuildTestPod("p13", 100, 0, node1.Name, func(pod *v1.Pod) {
pod.Namespace = "dev"
pod.ObjectMeta.CreationTimestamp = olderPodCreationTime
pod.ObjectMeta.Labels = map[string]string{"foo": "bar1"}
pod.ObjectMeta.OwnerReferences = ownerRef1
})
p14 := test.BuildTestPod("p14", 100, 0, node1.Name, nil)
p15 := test.BuildTestPod("p15", 100, 0, node1.Name, nil)