Skip to content

Commit 961344d

Browse files
authored
Merge pull request kubernetes#128124 from PiotrProkop/topology-manager-options-stable
topologymanager: Promote support for improved multi-numa alignment in Topology Manager to GA
2 parents a15840a + 37ac9aa commit 961344d

File tree

4 files changed

+45
-9
lines changed

4 files changed

+45
-9
lines changed

pkg/features/versioned_kube_features.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -726,6 +726,7 @@ var defaultVersionedKubernetesFeatureGates = map[featuregate.Feature]featuregate
726726
TopologyManagerPolicyOptions: {
727727
{Version: version.MustParse("1.26"), Default: false, PreRelease: featuregate.Alpha},
728728
{Version: version.MustParse("1.28"), Default: true, PreRelease: featuregate.Beta},
729+
{Version: version.MustParse("1.32"), Default: true, PreRelease: featuregate.GA},
729730
},
730731

731732
TranslateStreamCloseWebsocketRequests: {

pkg/kubelet/cm/topologymanager/policy_options.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,11 @@ const (
3434
var (
3535
alphaOptions = sets.New[string]()
3636
betaOptions = sets.New[string](
37-
PreferClosestNUMANodes,
3837
MaxAllowableNUMANodes,
3938
)
40-
stableOptions = sets.New[string]()
39+
stableOptions = sets.New[string](
40+
PreferClosestNUMANodes,
41+
)
4142
)
4243

4344
func CheckPolicyOptionAvailable(option string) error {

pkg/kubelet/cm/topologymanager/policy_options_test.go

Lines changed: 37 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,7 @@ func TestNewTopologyManagerOptions(t *testing.T) {
4747
expectedOptions PolicyOptions
4848
}{
4949
{
50-
description: "return TopologyManagerOptions with PreferClosestNUMA set to true",
51-
featureGate: pkgfeatures.TopologyManagerPolicyBetaOptions,
52-
featureGateEnable: true,
50+
description: "return TopologyManagerOptions with PreferClosestNUMA set to true",
5351
expectedOptions: PolicyOptions{
5452
PreferClosestNUMA: true,
5553
MaxAllowableNUMANodes: 8,
@@ -74,8 +72,7 @@ func TestNewTopologyManagerOptions(t *testing.T) {
7472
description: "fail to set option when TopologyManagerPolicyBetaOptions feature gate is not set",
7573
featureGate: pkgfeatures.TopologyManagerPolicyBetaOptions,
7674
policyOptions: map[string]string{
77-
PreferClosestNUMANodes: "true",
78-
MaxAllowableNUMANodes: "8",
75+
MaxAllowableNUMANodes: "8",
7976
},
8077
expectedErr: fmt.Errorf("Topology Manager Policy Beta-level Options not enabled,"),
8178
},
@@ -87,7 +84,6 @@ func TestNewTopologyManagerOptions(t *testing.T) {
8784
},
8885
{
8986
description: "fail to parse options with error PreferClosestNUMANodes",
90-
featureGate: pkgfeatures.TopologyManagerPolicyAlphaOptions,
9187
featureGateEnable: true,
9288
policyOptions: map[string]string{
9389
PreferClosestNUMANodes: "not a boolean",
@@ -177,6 +173,10 @@ func TestPolicyDefaultsAvailable(t *testing.T) {
177173
option: PreferClosestNUMANodes,
178174
expectedAvailable: true,
179175
},
176+
{
177+
option: MaxAllowableNUMANodes,
178+
expectedAvailable: true,
179+
},
180180
}
181181
for _, testCase := range testCases {
182182
t.Run(testCase.option, func(t *testing.T) {
@@ -206,7 +206,7 @@ func TestPolicyOptionsAvailable(t *testing.T) {
206206
{
207207
option: PreferClosestNUMANodes,
208208
featureGate: pkgfeatures.TopologyManagerPolicyBetaOptions,
209-
featureGateEnable: true,
209+
featureGateEnable: false,
210210
expectedAvailable: true,
211211
},
212212
{
@@ -215,10 +215,40 @@ func TestPolicyOptionsAvailable(t *testing.T) {
215215
featureGateEnable: false,
216216
expectedAvailable: true,
217217
},
218+
{
219+
option: fancyAlphaOption,
220+
featureGate: pkgfeatures.TopologyManagerPolicyAlphaOptions,
221+
featureGateEnable: true,
222+
expectedAvailable: true,
223+
},
224+
{
225+
option: fancyAlphaOption,
226+
featureGate: pkgfeatures.TopologyManagerPolicyAlphaOptions,
227+
featureGateEnable: false,
228+
expectedAvailable: false,
229+
},
230+
{
231+
option: fancyBetaOption,
232+
featureGate: pkgfeatures.TopologyManagerPolicyBetaOptions,
233+
featureGateEnable: true,
234+
expectedAvailable: true,
235+
},
236+
{
237+
option: fancyBetaOption,
238+
featureGate: pkgfeatures.TopologyManagerPolicyBetaOptions,
239+
featureGateEnable: false,
240+
expectedAvailable: false,
241+
},
218242
}
243+
betaOptions.Insert(fancyBetaOption)
244+
alphaOptions.Insert(fancyAlphaOption)
219245
for _, testCase := range testCases {
220246
t.Run(testCase.option, func(t *testing.T) {
221247
featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, testCase.featureGate, testCase.featureGateEnable)
248+
defer func() {
249+
// reset feature flag
250+
featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, testCase.featureGate, !testCase.featureGateEnable)
251+
}()
222252
err := CheckPolicyOptionAvailable(testCase.option)
223253
isEnabled := (err == nil)
224254
if isEnabled != testCase.expectedAvailable {

test/featuregates_linter/test_data/versioned_feature_list.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1302,6 +1302,10 @@
13021302
lockToDefault: false
13031303
preRelease: Beta
13041304
version: "1.28"
1305+
- default: true
1306+
lockToDefault: false
1307+
preRelease: GA
1308+
version: "1.32"
13051309
- name: TranslateStreamCloseWebsocketRequests
13061310
versionedSpecs:
13071311
- default: false

0 commit comments

Comments
 (0)