From 7c3a9d65fcab5baead51a094f81f2b30d5d7faa8 Mon Sep 17 00:00:00 2001 From: Tim Allclair Date: Thu, 21 Nov 2024 09:54:37 -0800 Subject: [PATCH] Don't set default resize policy in E2E tests --- test/e2e/common/node/pod_resize.go | 4 ---- test/e2e/framework/pod/resize.go | 15 --------------- test/e2e/node/pod_resize.go | 5 ----- 3 files changed, 24 deletions(-) diff --git a/test/e2e/common/node/pod_resize.go b/test/e2e/common/node/pod_resize.go index 7d773badf1e..f010f09df62 100644 --- a/test/e2e/common/node/pod_resize.go +++ b/test/e2e/common/node/pod_resize.go @@ -941,8 +941,6 @@ func doPodResizeTests(f *framework.Framework) { var pErr error tStamp := strconv.Itoa(time.Now().Nanosecond()) - e2epod.InitDefaultResizePolicy(tc.containers) - e2epod.InitDefaultResizePolicy(tc.expected) testPod = e2epod.MakePodWithResizableContainers(f.Namespace.Name, "", tStamp, tc.containers) testPod.GenerateName = "resize-test-" testPod = e2epod.MustMixinRestrictedPodSecurity(testPod) @@ -1128,8 +1126,6 @@ func doPodResizeErrorTests(f *framework.Framework) { var pErr error tStamp := strconv.Itoa(time.Now().Nanosecond()) - e2epod.InitDefaultResizePolicy(tc.containers) - e2epod.InitDefaultResizePolicy(tc.expected) testPod = e2epod.MakePodWithResizableContainers(f.Namespace.Name, "testpod", tStamp, tc.containers) testPod = e2epod.MustMixinRestrictedPodSecurity(testPod) diff --git a/test/e2e/framework/pod/resize.go b/test/e2e/framework/pod/resize.go index bc01b346450..415259ad8c5 100644 --- a/test/e2e/framework/pod/resize.go +++ b/test/e2e/framework/pod/resize.go @@ -142,21 +142,6 @@ func getTestResourceInfo(tcInfo ResizableContainerInfo) (res v1.ResourceRequirem return res, resizePol } -func InitDefaultResizePolicy(containers []ResizableContainerInfo) { - noRestart := v1.NotRequired - setDefaultPolicy := func(ci *ResizableContainerInfo) { - if ci.CPUPolicy == nil { - ci.CPUPolicy = &noRestart - } - if ci.MemPolicy == nil { - ci.MemPolicy = &noRestart - } - } - for i := range containers { - setDefaultPolicy(&containers[i]) - } -} - func makeResizableContainer(tcInfo ResizableContainerInfo) v1.Container { cmd := "grep Cpus_allowed_list /proc/self/status | cut -f2 && sleep 1d" res, resizePol := getTestResourceInfo(tcInfo) diff --git a/test/e2e/node/pod_resize.go b/test/e2e/node/pod_resize.go index bd70ba50955..0f33b6560c2 100644 --- a/test/e2e/node/pod_resize.go +++ b/test/e2e/node/pod_resize.go @@ -138,8 +138,6 @@ func doPodResizeAdmissionPluginsTests() { tc.enableAdmissionPlugin(ctx, f) tStamp := strconv.Itoa(time.Now().Nanosecond()) - e2epod.InitDefaultResizePolicy(containers) - e2epod.InitDefaultResizePolicy(expected) testPod1 := e2epod.MakePodWithResizableContainers(f.Namespace.Name, "testpod1", tStamp, containers) testPod1 = e2epod.MustMixinRestrictedPodSecurity(testPod1) testPod2 := e2epod.MakePodWithResizableContainers(f.Namespace.Name, "testpod2", tStamp, containers) @@ -267,8 +265,6 @@ func doPodResizeSchedulerTests(f *framework.Framework) { }`, testPod2CPUQuantityResized.MilliValue(), testPod2CPUQuantityResized.MilliValue()) tStamp := strconv.Itoa(time.Now().Nanosecond()) - e2epod.InitDefaultResizePolicy(c1) - e2epod.InitDefaultResizePolicy(c2) testPod1 := e2epod.MakePodWithResizableContainers(f.Namespace.Name, "testpod1", tStamp, c1) testPod1 = e2epod.MustMixinRestrictedPodSecurity(testPod1) testPod2 := e2epod.MakePodWithResizableContainers(f.Namespace.Name, "testpod2", tStamp, c2) @@ -324,7 +320,6 @@ func doPodResizeSchedulerTests(f *framework.Framework) { }`, testPod1CPUQuantityResized.MilliValue(), testPod1CPUQuantityResized.MilliValue()) tStamp = strconv.Itoa(time.Now().Nanosecond()) - e2epod.InitDefaultResizePolicy(c3) testPod3 := e2epod.MakePodWithResizableContainers(f.Namespace.Name, "testpod3", tStamp, c3) testPod3 = e2epod.MustMixinRestrictedPodSecurity(testPod3) e2epod.SetNodeAffinity(&testPod3.Spec, node.Name)