Skip to content

Commit a3a767b

Browse files
committed
WIP: fix e2e tests
Signed-off-by: Francesco Romani <[email protected]>
1 parent 4ca4725 commit a3a767b

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

test/e2e_node/cpu_manager_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,7 @@ type cpuManagerKubeletArguments struct {
294294
policyName string
295295
enableCPUManagerOptions bool
296296
disableCPUQuotaWithExclusiveCPUs bool
297+
enablePodLevelResources bool
297298
reservedSystemCPUs cpuset.CPUSet
298299
options map[string]string
299300
}
@@ -307,6 +308,7 @@ func configureCPUManagerInKubelet(oldCfg *kubeletconfig.KubeletConfiguration, ku
307308
newCfg.FeatureGates["CPUManagerPolicyBetaOptions"] = kubeletArguments.enableCPUManagerOptions
308309
newCfg.FeatureGates["CPUManagerPolicyAlphaOptions"] = kubeletArguments.enableCPUManagerOptions
309310
newCfg.FeatureGates["DisableCPUQuotaWithExclusiveCPUs"] = kubeletArguments.disableCPUQuotaWithExclusiveCPUs
311+
newCfg.FeatureGates["PodLevelResources"] = kubeletArguments.enablePodLevelResources
310312

311313
newCfg.CPUManagerPolicy = kubeletArguments.policyName
312314
newCfg.CPUManagerReconcilePeriod = metav1.Duration{Duration: 1 * time.Second}

test/e2e_node/cpumanager_test.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1989,8 +1989,9 @@ var _ = SIGDescribe("CPU Manager Incompatibility Pod Level Resources", ginkgo.Or
19891989
ginkgo.When("running guaranteed pod level resources tests", ginkgo.Label("guaranteed pod level resources", "reserved-cpus"), func() {
19901990
ginkgo.It("should let the container access all the online CPUs without a reserved CPUs set", func(ctx context.Context) {
19911991
updateKubeletConfigIfNeeded(ctx, f, configureCPUManagerInKubelet(oldCfg, &cpuManagerKubeletArguments{
1992-
policyName: string(cpumanager.PolicyStatic),
1993-
reservedSystemCPUs: cpuset.CPUSet{},
1992+
policyName: string(cpumanager.PolicyStatic),
1993+
reservedSystemCPUs: cpuset.CPUSet{},
1994+
enablePodLevelResources: true,
19941995
}))
19951996

19961997
pod := makeCPUManagerPod("gu-pod-level-resources", []ctnAttribute{
@@ -2023,8 +2024,9 @@ var _ = SIGDescribe("CPU Manager Incompatibility Pod Level Resources", ginkgo.Or
20232024
reservedCPUs = cpuset.New(0)
20242025

20252026
updateKubeletConfigIfNeeded(ctx, f, configureCPUManagerInKubelet(oldCfg, &cpuManagerKubeletArguments{
2026-
policyName: string(cpumanager.PolicyStatic),
2027-
reservedSystemCPUs: reservedCPUs, // Not really needed for the tests but helps to make a more precise check
2027+
policyName: string(cpumanager.PolicyStatic),
2028+
reservedSystemCPUs: reservedCPUs, // Not really needed for the tests but helps to make a more precise check
2029+
enablePodLevelResources: true,
20282030
}))
20292031

20302032
pod := makeCPUManagerPod("gu-pod-level-resources", []ctnAttribute{

test/e2e_node/memory_manager_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -778,6 +778,10 @@ var _ = SIGDescribe("Memory Manager Incompatibility Pod Level Resources", framew
778778
kubeParams := *defaultKubeParams
779779
kubeParams.policy = staticPolicy
780780
updateKubeletConfigWithMemoryManagerParams(initialConfig, &kubeParams)
781+
if initialConfig.FeatureGates == nil {
782+
initialConfig.FeatureGates = make(map[string]bool)
783+
}
784+
initialConfig.FeatureGates["PodLevelResources"] = true
781785
})
782786

783787
ginkgo.Context("", func() {

0 commit comments

Comments
 (0)