WIP: fix e2e tests

Signed-off-by: Francesco Romani <fromani@redhat.com>
This commit is contained in:
Francesco Romani 2025-07-29 17:54:39 +02:00
parent 4ca47255a8
commit a3a767b37e
3 changed files with 12 additions and 4 deletions

View file

@ -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}

View file

@ -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{

View file

@ -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() {