Skip to content

Commit 10c6a42

Browse files
committed
feat: graduate MatchLabelKeysInPodAffinity to GA
1 parent fd0a348 commit 10c6a42

File tree

15 files changed

+38
-24
lines changed

15 files changed

+38
-24
lines changed

api/openapi-spec/swagger.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/openapi-spec/v3/api__v1_openapi.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/openapi-spec/v3/apis__apps__v1_openapi.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/openapi-spec/v3/apis__batch__v1_openapi.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/api/pod/util_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2271,7 +2271,10 @@ func Test_dropDisabledMatchLabelKeysFieldInPodAffinity(t *testing.T) {
22712271

22722272
for _, test := range tests {
22732273
t.Run(test.name, func(t *testing.T) {
2274-
featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.MatchLabelKeysInPodAffinity, test.enabled)
2274+
if !test.enabled {
2275+
featuregatetesting.SetFeatureGateEmulationVersionDuringTest(t, utilfeature.DefaultFeatureGate, version.MustParse("1.32"))
2276+
featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.MatchLabelKeysInPodAffinity, false)
2277+
}
22752278

22762279
dropDisabledFields(test.podSpec, nil, test.oldPodSpec, nil)
22772280
if diff := cmp.Diff(test.wantPodSpec, test.podSpec); diff != "" {

pkg/apis/core/types.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3257,7 +3257,6 @@ type PodAffinityTerm struct {
32573257
// pod labels will be ignored. The default value is empty.
32583258
// The same key is forbidden to exist in both matchLabelKeys and labelSelector.
32593259
// Also, matchLabelKeys cannot be set when labelSelector isn't set.
3260-
// This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
32613260
//
32623261
// +listType=atomic
32633262
// +optional
@@ -3270,7 +3269,6 @@ type PodAffinityTerm struct {
32703269
// pod labels will be ignored. The default value is empty.
32713270
// The same key is forbidden to exist in both mismatchLabelKeys and labelSelector.
32723271
// Also, mismatchLabelKeys cannot be set when labelSelector isn't set.
3273-
// This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).
32743272
//
32753273
// +listType=atomic
32763274
// +optional

pkg/features/versioned_kube_features.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,7 @@ var defaultVersionedKubernetesFeatureGates = map[featuregate.Feature]featuregate
503503
MatchLabelKeysInPodAffinity: {
504504
{Version: version.MustParse("1.29"), Default: false, PreRelease: featuregate.Alpha},
505505
{Version: version.MustParse("1.31"), Default: true, PreRelease: featuregate.Beta},
506+
{Version: version.MustParse("1.33"), Default: true, PreRelease: featuregate.GA, LockToDefault: true},
506507
},
507508

508509
MatchLabelKeysInPodTopologySpread: {

pkg/generated/openapi/zz_generated.openapi.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/registry/core/pod/strategy_test.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import (
3636
"k8s.io/apimachinery/pkg/labels"
3737
"k8s.io/apimachinery/pkg/runtime"
3838
"k8s.io/apimachinery/pkg/types"
39+
"k8s.io/apimachinery/pkg/util/version"
3940
genericapirequest "k8s.io/apiserver/pkg/endpoints/request"
4041
utilfeature "k8s.io/apiserver/pkg/util/feature"
4142
"k8s.io/apiserver/pkg/warning"
@@ -1780,7 +1781,10 @@ func Test_mutatePodAffinity(t *testing.T) {
17801781

17811782
for _, tc := range tests {
17821783
t.Run(tc.name, func(t *testing.T) {
1783-
featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.MatchLabelKeysInPodAffinity, tc.featureGateEnabled)
1784+
if !tc.featureGateEnabled {
1785+
featuregatetesting.SetFeatureGateEmulationVersionDuringTest(t, utilfeature.DefaultFeatureGate, version.MustParse("1.32"))
1786+
featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.MatchLabelKeysInPodAffinity, false)
1787+
}
17841788

17851789
pod := tc.pod
17861790
mutatePodAffinity(pod)

staging/src/k8s.io/api/core/v1/generated.proto

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)