From 269bbac6e8db07bab7858553df4e93f6bd4e2d7d Mon Sep 17 00:00:00 2001 From: Mark Sasnal Date: Tue, 11 Feb 2025 17:34:04 -0500 Subject: [PATCH] KEP-4540: moved StrictCPUReservationOption to beta feature gate --- pkg/kubelet/cm/cpumanager/policy_options.go | 2 +- pkg/kubelet/cm/cpumanager/policy_options_test.go | 8 ++++---- pkg/kubelet/cm/cpumanager/policy_static_test.go | 2 -- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/pkg/kubelet/cm/cpumanager/policy_options.go b/pkg/kubelet/cm/cpumanager/policy_options.go index 5b30d04a3ce..80548fe666c 100644 --- a/pkg/kubelet/cm/cpumanager/policy_options.go +++ b/pkg/kubelet/cm/cpumanager/policy_options.go @@ -42,11 +42,11 @@ var ( DistributeCPUsAcrossNUMAOption, AlignBySocketOption, DistributeCPUsAcrossCoresOption, - StrictCPUReservationOption, PreferAlignByUnCoreCacheOption, ) betaOptions = sets.New[string]( FullPCPUsOnlyOption, + StrictCPUReservationOption, ) stableOptions = sets.New[string]() ) diff --git a/pkg/kubelet/cm/cpumanager/policy_options_test.go b/pkg/kubelet/cm/cpumanager/policy_options_test.go index e2c360bbfb7..90865038fd6 100644 --- a/pkg/kubelet/cm/cpumanager/policy_options_test.go +++ b/pkg/kubelet/cm/cpumanager/policy_options_test.go @@ -120,15 +120,15 @@ func TestPolicyOptionsAvailable(t *testing.T) { }, { option: StrictCPUReservationOption, - featureGate: pkgfeatures.CPUManagerPolicyAlphaOptions, - featureGateEnable: true, - expectedAvailable: true, + featureGate: pkgfeatures.CPUManagerPolicyBetaOptions, + featureGateEnable: false, + expectedAvailable: false, }, { option: StrictCPUReservationOption, featureGate: pkgfeatures.CPUManagerPolicyBetaOptions, featureGateEnable: true, - expectedAvailable: false, + expectedAvailable: true, }, } for _, testCase := range testCases { diff --git a/pkg/kubelet/cm/cpumanager/policy_static_test.go b/pkg/kubelet/cm/cpumanager/policy_static_test.go index 73003a2a5c4..db3a3649b56 100644 --- a/pkg/kubelet/cm/cpumanager/policy_static_test.go +++ b/pkg/kubelet/cm/cpumanager/policy_static_test.go @@ -170,7 +170,6 @@ func TestStaticPolicyStart(t *testing.T) { } for _, testCase := range testCases { t.Run(testCase.description, func(t *testing.T) { - featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, pkgfeatures.CPUManagerPolicyAlphaOptions, true) p, err := NewStaticPolicy(testCase.topo, testCase.numReservedCPUs, cpuset.New(), topologymanager.NewFakeManager(), testCase.options) if err != nil { t.Fatalf("NewStaticPolicy() failed: %v", err) @@ -1050,7 +1049,6 @@ func TestStaticPolicyStartWithResvList(t *testing.T) { } for _, testCase := range testCases { t.Run(testCase.description, func(t *testing.T) { - featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, pkgfeatures.CPUManagerPolicyAlphaOptions, true) p, err := NewStaticPolicy(testCase.topo, testCase.numReservedCPUs, testCase.reserved, topologymanager.NewFakeManager(), testCase.cpuPolicyOptions) if !reflect.DeepEqual(err, testCase.expNewErr) { t.Errorf("StaticPolicy Start() error (%v). expected error: %v but got: %v",