mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 04:33:26 +00:00
KEP-4540: moved StrictCPUReservationOption to beta feature gate
This commit is contained in:
parent
2cb9e77fde
commit
269bbac6e8
@ -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]()
|
||||||
)
|
)
|
||||||
|
@ -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 {
|
||||||
|
@ -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",
|
||||||
|
Loading…
Reference in New Issue
Block a user