From 2f90d1dd01903981299617ce4ce1a47cf2feba45 Mon Sep 17 00:00:00 2001 From: Jan Chaloupka Date: Mon, 15 Dec 2025 16:43:32 +0100 Subject: [PATCH] refactor(node_taint_test): apply pod single creation convention for p9 --- .../node_taint_test.go | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/pkg/framework/plugins/removepodsviolatingnodetaints/node_taint_test.go b/pkg/framework/plugins/removepodsviolatingnodetaints/node_taint_test.go index ddc8d57a0..20d8587d9 100644 --- a/pkg/framework/plugins/removepodsviolatingnodetaints/node_taint_test.go +++ b/pkg/framework/plugins/removepodsviolatingnodetaints/node_taint_test.go @@ -153,11 +153,23 @@ func TestDeletePodsViolatingNodeTaints(t *testing.T) { p8 := buildTestPod("p8", nodeName2, func(pod *v1.Pod) { pod.ObjectMeta.OwnerReferences = test.GetDaemonSetOwnerRefList() }) - p9 := buildTestPod("p9", nodeName2, nil) + p9 := buildTestPod("p9", nodeName2, func(pod *v1.Pod) { + pod.ObjectMeta.OwnerReferences = test.GetNormalPodOwnerRefList() + pod.Spec.Volumes = []v1.Volume{ + { + Name: "sample", + VolumeSource: v1.VolumeSource{ + HostPath: &v1.HostPathVolumeSource{Path: "somePath"}, + EmptyDir: &v1.EmptyDirVolumeSource{ + SizeLimit: resource.NewQuantity(int64(10), resource.BinarySI), + }, + }, + }, + } + }) p10 := buildTestPod("p10", nodeName2, nil) p11 := buildTestPod("p11", nodeName2, nil) p12 := buildTestPod("p11", nodeName2, nil) - p9.ObjectMeta.OwnerReferences = test.GetNormalPodOwnerRefList() p10.ObjectMeta.OwnerReferences = test.GetNormalPodOwnerRefList() p11.ObjectMeta.OwnerReferences = test.GetNormalPodOwnerRefList() p12.ObjectMeta.OwnerReferences = test.GetNormalPodOwnerRefList() @@ -166,18 +178,6 @@ func TestDeletePodsViolatingNodeTaints(t *testing.T) { // A Critical Pod. // A daemonset. // A pod with local storage. - p9.ObjectMeta.OwnerReferences = test.GetNormalPodOwnerRefList() - p9.Spec.Volumes = []v1.Volume{ - { - Name: "sample", - VolumeSource: v1.VolumeSource{ - HostPath: &v1.HostPathVolumeSource{Path: "somePath"}, - EmptyDir: &v1.EmptyDirVolumeSource{ - SizeLimit: resource.NewQuantity(int64(10), resource.BinarySI), - }, - }, - }, - } // A Mirror Pod. p10.Annotations = test.GetMirrorPodAnnotation()