KEP-4540: moved StrictCPUReservationOption to beta feature gate

This commit is contained in:
Mark Sasnal 2025-02-11 17:34:04 -05:00
parent 2cb9e77fde
commit 269bbac6e8
3 changed files with 5 additions and 7 deletions

View File

@ -42,11 +42,11 @@ var (
DistributeCPUsAcrossNUMAOption, DistributeCPUsAcrossNUMAOption,
AlignBySocketOption, AlignBySocketOption,
DistributeCPUsAcrossCoresOption, DistributeCPUsAcrossCoresOption,
StrictCPUReservationOption,
PreferAlignByUnCoreCacheOption, PreferAlignByUnCoreCacheOption,
) )
betaOptions = sets.New[string]( betaOptions = sets.New[string](
FullPCPUsOnlyOption, FullPCPUsOnlyOption,
StrictCPUReservationOption,
) )
stableOptions = sets.New[string]() stableOptions = sets.New[string]()
) )

View File

@ -120,15 +120,15 @@ func TestPolicyOptionsAvailable(t *testing.T) {
}, },
{ {
option: StrictCPUReservationOption, option: StrictCPUReservationOption,
featureGate: pkgfeatures.CPUManagerPolicyAlphaOptions, featureGate: pkgfeatures.CPUManagerPolicyBetaOptions,
featureGateEnable: true, featureGateEnable: false,
expectedAvailable: true, expectedAvailable: false,
}, },
{ {
option: StrictCPUReservationOption, option: StrictCPUReservationOption,
featureGate: pkgfeatures.CPUManagerPolicyBetaOptions, featureGate: pkgfeatures.CPUManagerPolicyBetaOptions,
featureGateEnable: true, featureGateEnable: true,
expectedAvailable: false, expectedAvailable: true,
}, },
} }
for _, testCase := range testCases { for _, testCase := range testCases {

View File

@ -170,7 +170,6 @@ func TestStaticPolicyStart(t *testing.T) {
} }
for _, testCase := range testCases { for _, testCase := range testCases {
t.Run(testCase.description, func(t *testing.T) { 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) p, err := NewStaticPolicy(testCase.topo, testCase.numReservedCPUs, cpuset.New(), topologymanager.NewFakeManager(), testCase.options)
if err != nil { if err != nil {
t.Fatalf("NewStaticPolicy() failed: %v", err) t.Fatalf("NewStaticPolicy() failed: %v", err)
@ -1050,7 +1049,6 @@ func TestStaticPolicyStartWithResvList(t *testing.T) {
} }
for _, testCase := range testCases { for _, testCase := range testCases {
t.Run(testCase.description, func(t *testing.T) { 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) p, err := NewStaticPolicy(testCase.topo, testCase.numReservedCPUs, testCase.reserved, topologymanager.NewFakeManager(), testCase.cpuPolicyOptions)
if !reflect.DeepEqual(err, testCase.expNewErr) { if !reflect.DeepEqual(err, testCase.expNewErr) {
t.Errorf("StaticPolicy Start() error (%v). expected error: %v but got: %v", t.Errorf("StaticPolicy Start() error (%v). expected error: %v but got: %v",