1
0
mirror of https://github.com/kubernetes-sigs/descheduler.git synced 2026-01-26 13:29:11 +01:00

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

This commit is contained in:
Jan Chaloupka
2025-12-14 12:30:58 +01:00
parent 7435b5d474
commit f2031ddcb0

View File

@@ -120,8 +120,10 @@ func TestFindDuplicatePods(t *testing.T) {
pod.Namespace = "test"
pod.ObjectMeta.OwnerReferences = ownerRef2
})
p10 := test.BuildTestPod("p10", 100, 0, node1.Name, nil)
p10.Namespace = "test"
p10 := test.BuildTestPod("p10", 100, 0, node1.Name, func(pod *v1.Pod) {
pod.Namespace = "test"
pod.ObjectMeta.OwnerReferences = ownerRef2
})
p11 := test.BuildTestPod("p11", 100, 0, node1.Name, nil)
p11.Namespace = "different-images"
p12 := test.BuildTestPod("p12", 100, 0, node1.Name, nil)
@@ -149,8 +151,6 @@ func TestFindDuplicatePods(t *testing.T) {
// ### Evictable Pods ###
p10.ObjectMeta.OwnerReferences = ownerRef2
// ### Non-evictable Pods ###
// Same owners, but different images