Skip to content

Commit 41dd679

Browse files
authored
Merge pull request kubernetes#130920 from kerthcet/feat/promote-to-ga
KEP-3094: Promote NodeInclusionPolicyInPodTopologySpread to Stable
2 parents aa35eff + 1a34095 commit 41dd679

File tree

15 files changed

+38
-22
lines changed

15 files changed

+38
-22
lines changed

api/openapi-spec/swagger.json

+2-2
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

+2-2
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

+2-2
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

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/api/pod/util_test.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -1416,7 +1416,11 @@ func TestDropNodeInclusionPolicyFields(t *testing.T) {
14161416

14171417
for _, test := range tests {
14181418
t.Run(test.name, func(t *testing.T) {
1419-
featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.NodeInclusionPolicyInPodTopologySpread, test.enabled)
1419+
if !test.enabled {
1420+
// TODO: this will be removed in 1.36
1421+
featuregatetesting.SetFeatureGateEmulationVersionDuringTest(t, utilfeature.DefaultFeatureGate, version.MustParse("1.32"))
1422+
featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.NodeInclusionPolicyInPodTopologySpread, test.enabled)
1423+
}
14201424

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

pkg/apis/core/types.go

-2
Original file line numberDiff line numberDiff line change
@@ -6723,7 +6723,6 @@ type TopologySpreadConstraint struct {
67236723
// - Ignore: nodeAffinity/nodeSelector are ignored. All nodes are included in the calculations.
67246724
//
67256725
// If this value is nil, the behavior is equivalent to the Honor policy.
6726-
// This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag.
67276726
// +optional
67286727
NodeAffinityPolicy *NodeInclusionPolicy
67296728
// NodeTaintsPolicy indicates how we will treat node taints when calculating
@@ -6733,7 +6732,6 @@ type TopologySpreadConstraint struct {
67336732
// - Ignore: node taints are ignored. All nodes are included.
67346733
//
67356734
// If this value is nil, the behavior is equivalent to the Ignore policy.
6736-
// This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag.
67376735
// +optional
67386736
NodeTaintsPolicy *NodeInclusionPolicy
67396737
// MatchLabelKeys is a set of pod label keys to select the pods over which

pkg/features/kube_features.go

+1
Original file line numberDiff line numberDiff line change
@@ -1502,6 +1502,7 @@ var defaultVersionedKubernetesFeatureGates = map[featuregate.Feature]featuregate
15021502
NodeInclusionPolicyInPodTopologySpread: {
15031503
{Version: version.MustParse("1.25"), Default: false, PreRelease: featuregate.Alpha},
15041504
{Version: version.MustParse("1.26"), Default: true, PreRelease: featuregate.Beta},
1505+
{Version: version.MustParse("1.33"), Default: true, PreRelease: featuregate.GA, LockToDefault: true},
15051506
},
15061507

15071508
NodeLogQuery: {

pkg/generated/openapi/zz_generated.openapi.go

+2-2
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

+6-1
Original file line numberDiff line numberDiff line change
@@ -1340,7 +1340,11 @@ func TestNodeInclusionPolicyEnablementInCreating(t *testing.T) {
13401340

13411341
for _, tc := range tests {
13421342
t.Run(tc.name, func(t *testing.T) {
1343-
featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.NodeInclusionPolicyInPodTopologySpread, tc.enableNodeInclusionPolicy)
1343+
if !tc.enableNodeInclusionPolicy {
1344+
// TODO: this will be removed in 1.36
1345+
featuregatetesting.SetFeatureGateEmulationVersionDuringTest(t, utilfeature.DefaultFeatureGate, version.MustParse("1.32"))
1346+
featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.NodeInclusionPolicyInPodTopologySpread, tc.enableNodeInclusionPolicy)
1347+
}
13441348

13451349
pod := podtest.MakePod("foo", podtest.SetGeneration(1))
13461350
wantPod := pod.DeepCopy()
@@ -1394,6 +1398,7 @@ func TestNodeInclusionPolicyEnablementInUpdating(t *testing.T) {
13941398
t.Error("NodeInclusionPolicy created with unexpected result")
13951399
}
13961400

1401+
featuregatetesting.SetFeatureGateEmulationVersionDuringTest(t, utilfeature.DefaultFeatureGate, version.MustParse("1.32"))
13971402
// Disable the Feature Gate and expect these fields still exist after updating.
13981403
featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.NodeInclusionPolicyInPodTopologySpread, false)
13991404

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

-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

staging/src/k8s.io/api/core/v1/types.go

-2
Original file line numberDiff line numberDiff line change
@@ -4325,7 +4325,6 @@ type TopologySpreadConstraint struct {
43254325
// - Ignore: nodeAffinity/nodeSelector are ignored. All nodes are included in the calculations.
43264326
//
43274327
// If this value is nil, the behavior is equivalent to the Honor policy.
4328-
// This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag.
43294328
// +optional
43304329
NodeAffinityPolicy *NodeInclusionPolicy `json:"nodeAffinityPolicy,omitempty" protobuf:"bytes,6,opt,name=nodeAffinityPolicy"`
43314330
// NodeTaintsPolicy indicates how we will treat node taints when calculating
@@ -4335,7 +4334,6 @@ type TopologySpreadConstraint struct {
43354334
// - Ignore: node taints are ignored. All nodes are included.
43364335
//
43374336
// If this value is nil, the behavior is equivalent to the Ignore policy.
4338-
// This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag.
43394337
// +optional
43404338
NodeTaintsPolicy *NodeInclusionPolicy `json:"nodeTaintsPolicy,omitempty" protobuf:"bytes,7,opt,name=nodeTaintsPolicy"`
43414339
// MatchLabelKeys is a set of pod label keys to select the pods over which

0 commit comments

Comments
 (0)