From bab6df857c2bf28e561011ea3c7d4f5c71bccb89 Mon Sep 17 00:00:00 2001 From: Tim Allclair Date: Wed, 6 Nov 2024 23:30:28 -0800 Subject: [PATCH] Add resize e2e tests around min CPU shares --- test/e2e/common/node/pod_resize.go | 34 ++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/test/e2e/common/node/pod_resize.go b/test/e2e/common/node/pod_resize.go index 4cbce31db6c..21a756cf0b9 100644 --- a/test/e2e/common/node/pod_resize.go +++ b/test/e2e/common/node/pod_resize.go @@ -566,6 +566,24 @@ func doPodResizeTests(f *framework.Framework) { }, }, }, + { + name: "Burstable QoS pod, one container with cpu requests - resize with equivalent request", + containers: []e2epod.ResizableContainerInfo{ + { + Name: "c1", + Resources: &e2epod.ContainerResources{CPUReq: "2m"}, + }, + }, + patchString: `{"spec":{"containers":[ + {"name":"c1", "resources":{"requests":{"cpu":"1m"}}} + ]}}`, + expected: []e2epod.ResizableContainerInfo{ + { + Name: "c1", + Resources: &e2epod.ContainerResources{CPUReq: "1m"}, + }, + }, + }, { name: "Guaranteed QoS pod, one container - increase CPU (NotRequired) & memory (RestartContainer)", testRollback: true, @@ -783,6 +801,22 @@ func doPodResizeTests(f *framework.Framework) { }, addExtendedResource: true, }, + { + name: "BestEffort QoS pod - empty resize", + containers: []e2epod.ResizableContainerInfo{ + { + Name: "c1", + Resources: &e2epod.ContainerResources{}, + }, + }, + patchString: `{}`, + expected: []e2epod.ResizableContainerInfo{ + { + Name: "c1", + Resources: &e2epod.ContainerResources{}, + }, + }, + }, } for idx := range tests {