From a3a767b37ec6e8e14d53f5f477df5519586d098f Mon Sep 17 00:00:00 2001 From: Francesco Romani Date: Tue, 29 Jul 2025 17:54:39 +0200 Subject: [PATCH] WIP: fix e2e tests Signed-off-by: Francesco Romani --- test/e2e_node/cpu_manager_test.go | 2 ++ test/e2e_node/cpumanager_test.go | 10 ++++++---- test/e2e_node/memory_manager_test.go | 4 ++++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/test/e2e_node/cpu_manager_test.go b/test/e2e_node/cpu_manager_test.go index 892aa0ee7d8..d27c76c841c 100644 --- a/test/e2e_node/cpu_manager_test.go +++ b/test/e2e_node/cpu_manager_test.go @@ -294,6 +294,7 @@ type cpuManagerKubeletArguments struct { policyName string enableCPUManagerOptions bool disableCPUQuotaWithExclusiveCPUs bool + enablePodLevelResources bool reservedSystemCPUs cpuset.CPUSet options map[string]string } @@ -307,6 +308,7 @@ func configureCPUManagerInKubelet(oldCfg *kubeletconfig.KubeletConfiguration, ku newCfg.FeatureGates["CPUManagerPolicyBetaOptions"] = kubeletArguments.enableCPUManagerOptions newCfg.FeatureGates["CPUManagerPolicyAlphaOptions"] = kubeletArguments.enableCPUManagerOptions newCfg.FeatureGates["DisableCPUQuotaWithExclusiveCPUs"] = kubeletArguments.disableCPUQuotaWithExclusiveCPUs + newCfg.FeatureGates["PodLevelResources"] = kubeletArguments.enablePodLevelResources newCfg.CPUManagerPolicy = kubeletArguments.policyName newCfg.CPUManagerReconcilePeriod = metav1.Duration{Duration: 1 * time.Second} diff --git a/test/e2e_node/cpumanager_test.go b/test/e2e_node/cpumanager_test.go index eed312cc922..e5069b9ce24 100644 --- a/test/e2e_node/cpumanager_test.go +++ b/test/e2e_node/cpumanager_test.go @@ -1989,8 +1989,9 @@ var _ = SIGDescribe("CPU Manager Incompatibility Pod Level Resources", ginkgo.Or ginkgo.When("running guaranteed pod level resources tests", ginkgo.Label("guaranteed pod level resources", "reserved-cpus"), func() { ginkgo.It("should let the container access all the online CPUs without a reserved CPUs set", func(ctx context.Context) { updateKubeletConfigIfNeeded(ctx, f, configureCPUManagerInKubelet(oldCfg, &cpuManagerKubeletArguments{ - policyName: string(cpumanager.PolicyStatic), - reservedSystemCPUs: cpuset.CPUSet{}, + policyName: string(cpumanager.PolicyStatic), + reservedSystemCPUs: cpuset.CPUSet{}, + enablePodLevelResources: true, })) pod := makeCPUManagerPod("gu-pod-level-resources", []ctnAttribute{ @@ -2023,8 +2024,9 @@ var _ = SIGDescribe("CPU Manager Incompatibility Pod Level Resources", ginkgo.Or reservedCPUs = cpuset.New(0) updateKubeletConfigIfNeeded(ctx, f, configureCPUManagerInKubelet(oldCfg, &cpuManagerKubeletArguments{ - policyName: string(cpumanager.PolicyStatic), - reservedSystemCPUs: reservedCPUs, // Not really needed for the tests but helps to make a more precise check + policyName: string(cpumanager.PolicyStatic), + reservedSystemCPUs: reservedCPUs, // Not really needed for the tests but helps to make a more precise check + enablePodLevelResources: true, })) pod := makeCPUManagerPod("gu-pod-level-resources", []ctnAttribute{ diff --git a/test/e2e_node/memory_manager_test.go b/test/e2e_node/memory_manager_test.go index 23867970d71..c28f5d4eb4a 100644 --- a/test/e2e_node/memory_manager_test.go +++ b/test/e2e_node/memory_manager_test.go @@ -778,6 +778,10 @@ var _ = SIGDescribe("Memory Manager Incompatibility Pod Level Resources", framew kubeParams := *defaultKubeParams kubeParams.policy = staticPolicy updateKubeletConfigWithMemoryManagerParams(initialConfig, &kubeParams) + if initialConfig.FeatureGates == nil { + initialConfig.FeatureGates = make(map[string]bool) + } + initialConfig.FeatureGates["PodLevelResources"] = true }) ginkgo.Context("", func() {