From 8db1426554dcd091cdb8f0d78001cfa877b4eb4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20K=C5=99epinsk=C3=BD?= Date: Thu, 27 Mar 2025 19:05:12 +0100 Subject: [PATCH] rename DeploymentPodReplacementPolicy FG to DeploymentReplicaSetTerminatingReplicas --- CHANGELOG/CHANGELOG-1.33.md | 2 +- api/openapi-spec/swagger.json | 4 +- .../v3/apis__apps__v1_openapi.json | 4 +- pkg/apis/apps/types.go | 4 +- pkg/controller/deployment/sync.go | 2 +- .../deployment/util/deployment_util_test.go | 16 +++---- pkg/controller/replicaset/replica_set.go | 2 +- .../replicaset/replica_set_utils.go | 4 +- .../replicaset/replica_set_utils_test.go | 20 ++++----- pkg/features/kube_features.go | 4 +- pkg/generated/openapi/zz_generated.openapi.go | 14 +++--- pkg/registry/apps/deployment/strategy.go | 2 +- pkg/registry/apps/deployment/strategy_test.go | 44 +++++++++---------- pkg/registry/apps/replicaset/strategy.go | 2 +- pkg/registry/apps/replicaset/strategy_test.go | 44 +++++++++---------- .../src/k8s.io/api/apps/v1/generated.proto | 4 +- staging/src/k8s.io/api/apps/v1/types.go | 4 +- .../apps/v1/types_swagger_doc_generated.go | 4 +- .../k8s.io/api/apps/v1beta1/generated.proto | 2 +- staging/src/k8s.io/api/apps/v1beta1/types.go | 2 +- .../v1beta1/types_swagger_doc_generated.go | 2 +- .../k8s.io/api/apps/v1beta2/generated.proto | 4 +- staging/src/k8s.io/api/apps/v1beta2/types.go | 4 +- .../v1beta2/types_swagger_doc_generated.go | 4 +- .../api/extensions/v1beta1/generated.proto | 4 +- .../k8s.io/api/extensions/v1beta1/types.go | 4 +- .../v1beta1/types_swagger_doc_generated.go | 4 +- .../reference/versioned_feature_list.yaml | 2 +- .../integration/deployment/deployment_test.go | 6 +-- .../integration/replicaset/replicaset_test.go | 6 +-- 30 files changed, 112 insertions(+), 112 deletions(-) diff --git a/CHANGELOG/CHANGELOG-1.33.md b/CHANGELOG/CHANGELOG-1.33.md index 1f8eb4f4c58..d4602720c51 100644 --- a/CHANGELOG/CHANGELOG-1.33.md +++ b/CHANGELOG/CHANGELOG-1.33.md @@ -614,7 +614,7 @@ name | architectures ### API Change -- A new status field `.status.terminatingReplicas` is added to Deployments and ReplicaSets to allow tracking of terminating pods when the DeploymentPodReplacementPolicy feature-gate is enabled. ([#128546](https://github.com/kubernetes/kubernetes/pull/128546), [@atiratree](https://github.com/atiratree)) [SIG API Machinery, Apps and Testing] +- A new status field `.status.terminatingReplicas` is added to Deployments and ReplicaSets to allow tracking of terminating pods when the DeploymentReplicaSetTerminatingReplicas feature-gate is enabled. ([#128546](https://github.com/kubernetes/kubernetes/pull/128546), [@atiratree](https://github.com/atiratree)) [SIG API Machinery, Apps and Testing] - DRA API: the maximum number of pods which can use the same ResourceClaim is now 256 instead of 32. Beware that downgrading a cluster where this relaxed limit is in use to Kubernetes 1.32.0 is not supported because 1.32.0 would refuse to update ResourceClaims with more than 32 entries in the status.reservedFor field. ([#129543](https://github.com/kubernetes/kubernetes/pull/129543), [@pohly](https://github.com/pohly)) [SIG API Machinery, Node and Testing] - DRA: CEL expressions using attribute strings exceeded the cost limit because their cost estimation was incomplete. ([#129661](https://github.com/kubernetes/kubernetes/pull/129661), [@pohly](https://github.com/pohly)) [SIG Node] - DRA: when asking for "All" devices on a node, Kubernetes <= 1.32 proceeded to schedule pods onto nodes with no devices by not allocating any devices for those pods. Kubernetes 1.33 changes that to only picking nodes which have at least one device. Users who want the "proceed with scheduling also without devices" semantic can use the upcoming prioritized list feature with one sub-request for "all" devices and a second alternative with "count: 0". ([#129560](https://github.com/kubernetes/kubernetes/pull/129560), [@bart0sh](https://github.com/bart0sh)) [SIG API Machinery and Node] diff --git a/api/openapi-spec/swagger.json b/api/openapi-spec/swagger.json index d53dd5cf63d..65ced1bc619 100644 --- a/api/openapi-spec/swagger.json +++ b/api/openapi-spec/swagger.json @@ -2395,7 +2395,7 @@ "type": "integer" }, "terminatingReplicas": { - "description": "Total number of terminating pods targeted by this deployment. Terminating pods have a non-null .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase.\n\nThis is an alpha field. Enable DeploymentPodReplacementPolicy to be able to use this field.", + "description": "Total number of terminating pods targeted by this deployment. Terminating pods have a non-null .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase.\n\nThis is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field.", "format": "int32", "type": "integer" }, @@ -2593,7 +2593,7 @@ "type": "integer" }, "terminatingReplicas": { - "description": "The number of terminating pods for this replica set. Terminating pods have a non-null .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase.\n\nThis is an alpha field. Enable DeploymentPodReplacementPolicy to be able to use this field.", + "description": "The number of terminating pods for this replica set. Terminating pods have a non-null .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase.\n\nThis is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field.", "format": "int32", "type": "integer" } diff --git a/api/openapi-spec/v3/apis__apps__v1_openapi.json b/api/openapi-spec/v3/apis__apps__v1_openapi.json index f4da9c923f5..d44a2e4c2d1 100644 --- a/api/openapi-spec/v3/apis__apps__v1_openapi.json +++ b/api/openapi-spec/v3/apis__apps__v1_openapi.json @@ -610,7 +610,7 @@ "type": "integer" }, "terminatingReplicas": { - "description": "Total number of terminating pods targeted by this deployment. Terminating pods have a non-null .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase.\n\nThis is an alpha field. Enable DeploymentPodReplacementPolicy to be able to use this field.", + "description": "Total number of terminating pods targeted by this deployment. Terminating pods have a non-null .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase.\n\nThis is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field.", "format": "int32", "type": "integer" }, @@ -858,7 +858,7 @@ "type": "integer" }, "terminatingReplicas": { - "description": "The number of terminating pods for this replica set. Terminating pods have a non-null .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase.\n\nThis is an alpha field. Enable DeploymentPodReplacementPolicy to be able to use this field.", + "description": "The number of terminating pods for this replica set. Terminating pods have a non-null .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase.\n\nThis is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field.", "format": "int32", "type": "integer" } diff --git a/pkg/apis/apps/types.go b/pkg/apis/apps/types.go index a3b7786d462..7e4bf6d49bd 100644 --- a/pkg/apis/apps/types.go +++ b/pkg/apis/apps/types.go @@ -533,7 +533,7 @@ type DeploymentStatus struct { // Total number of terminating pods targeted by this deployment. Terminating pods have a non-null // .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase. // - // This is an alpha field. Enable DeploymentPodReplacementPolicy to be able to use this field. + // This is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field. // +optional TerminatingReplicas *int32 @@ -892,7 +892,7 @@ type ReplicaSetStatus struct { // The number of terminating pods for this replica set. Terminating pods have a non-null .metadata.deletionTimestamp // and have not yet reached the Failed or Succeeded .status.phase. // - // This is an alpha field. Enable DeploymentPodReplacementPolicy to be able to use this field. + // This is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field. // +optional TerminatingReplicas *int32 diff --git a/pkg/controller/deployment/sync.go b/pkg/controller/deployment/sync.go index b924e4cf589..0e06d3764d3 100644 --- a/pkg/controller/deployment/sync.go +++ b/pkg/controller/deployment/sync.go @@ -506,7 +506,7 @@ func calculateStatus(allRSs []*apps.ReplicaSet, newRS *apps.ReplicaSet, deployme UnavailableReplicas: unavailableReplicas, CollisionCount: deployment.Status.CollisionCount, } - if utilfeature.DefaultFeatureGate.Enabled(features.DeploymentPodReplacementPolicy) { + if utilfeature.DefaultFeatureGate.Enabled(features.DeploymentReplicaSetTerminatingReplicas) { status.TerminatingReplicas = deploymentutil.GetTerminatingReplicaCountForReplicaSets(allRSs) } diff --git a/pkg/controller/deployment/util/deployment_util_test.go b/pkg/controller/deployment/util/deployment_util_test.go index 55349d7a9a1..56440fab659 100644 --- a/pkg/controller/deployment/util/deployment_util_test.go +++ b/pkg/controller/deployment/util/deployment_util_test.go @@ -1455,14 +1455,14 @@ func TestMinAvailable(t *testing.T) { func TestGetReplicaSetFraction(t *testing.T) { tests := []struct { - name string - enableDeploymentPodReplacementPolicy bool - deploymentReplicas int32 - deploymentStatusReplicas int32 - deploymentMaxSurge int32 - rsReplicas int32 - rsAnnotations map[string]string - expectedFraction int32 + name string + enableDeploymentReplicaSetTerminatingReplicas bool + deploymentReplicas int32 + deploymentStatusReplicas int32 + deploymentMaxSurge int32 + rsReplicas int32 + rsAnnotations map[string]string + expectedFraction int32 }{ { name: "empty deployment always scales to 0", diff --git a/pkg/controller/replicaset/replica_set.go b/pkg/controller/replicaset/replica_set.go index ada439d360e..a50b56b6887 100644 --- a/pkg/controller/replicaset/replica_set.go +++ b/pkg/controller/replicaset/replica_set.go @@ -719,7 +719,7 @@ func (rsc *ReplicaSetController) syncReplicaSet(ctx context.Context, key string) } var terminatingPods []*v1.Pod - if utilfeature.DefaultFeatureGate.Enabled(features.DeploymentPodReplacementPolicy) { + if utilfeature.DefaultFeatureGate.Enabled(features.DeploymentReplicaSetTerminatingReplicas) { allTerminatingPods := controller.FilterTerminatingPods(allPods) terminatingPods = controller.FilterClaimedPods(rs, selector, allTerminatingPods) } diff --git a/pkg/controller/replicaset/replica_set_utils.go b/pkg/controller/replicaset/replica_set_utils.go index b4e826cb3d9..cb4754f6f1e 100644 --- a/pkg/controller/replicaset/replica_set_utils.go +++ b/pkg/controller/replicaset/replica_set_utils.go @@ -61,7 +61,7 @@ func updateReplicaSetStatus(logger klog.Logger, c appsclient.ReplicaSetInterface var updatedRS *apps.ReplicaSet for i, rs := 0, rs; ; i++ { terminatingReplicasUpdateInfo := "" - if utilfeature.DefaultFeatureGate.Enabled(features.DeploymentPodReplacementPolicy) { + if utilfeature.DefaultFeatureGate.Enabled(features.DeploymentReplicaSetTerminatingReplicas) { terminatingReplicasUpdateInfo = fmt.Sprintf("terminatingReplicas %s->%s, ", derefInt32ToStr(rs.Status.TerminatingReplicas), derefInt32ToStr(newStatus.TerminatingReplicas)) } logger.V(4).Info(fmt.Sprintf("Updating status for %v: %s/%s, ", rs.Kind, rs.Namespace, rs.Name) + @@ -116,7 +116,7 @@ func calculateStatus(rs *apps.ReplicaSet, activePods []*v1.Pod, terminatingPods } var terminatingReplicasCount *int32 - if utilfeature.DefaultFeatureGate.Enabled(features.DeploymentPodReplacementPolicy) { + if utilfeature.DefaultFeatureGate.Enabled(features.DeploymentReplicaSetTerminatingReplicas) { terminatingReplicasCount = ptr.To(int32(len(terminatingPods))) } diff --git a/pkg/controller/replicaset/replica_set_utils_test.go b/pkg/controller/replicaset/replica_set_utils_test.go index c3dc41d790e..27f2fd0caed 100644 --- a/pkg/controller/replicaset/replica_set_utils_test.go +++ b/pkg/controller/replicaset/replica_set_utils_test.go @@ -47,12 +47,12 @@ func TestCalculateStatus(t *testing.T) { } rsStatusTests := []struct { - name string - enableDeploymentPodReplacementPolicy bool - replicaset *apps.ReplicaSet - activePods []*v1.Pod - terminatingPods []*v1.Pod - expectedReplicaSetStatus apps.ReplicaSetStatus + name string + enableDeploymentReplicaSetTerminatingReplicas bool + replicaset *apps.ReplicaSet + activePods []*v1.Pod + terminatingPods []*v1.Pod + expectedReplicaSetStatus apps.ReplicaSetStatus }{ { "1 fully labelled pod", @@ -104,7 +104,7 @@ func TestCalculateStatus(t *testing.T) { }, }, { - "2 fully labelled pods with DeploymentPodReplacementPolicy", + "2 fully labelled pods with DeploymentReplicaSetTerminatingReplicas", true, fullyLabelledRS, []*v1.Pod{ @@ -187,7 +187,7 @@ func TestCalculateStatus(t *testing.T) { }, }, { - "1 fully labelled pod and 1 terminating without DeploymentPodReplacementPolicy", + "1 fully labelled pod and 1 terminating without DeploymentReplicaSetTerminatingReplicas", false, fullyLabelledRS, []*v1.Pod{ @@ -205,7 +205,7 @@ func TestCalculateStatus(t *testing.T) { }, }, { - "1 fully labelled pods and 2 terminating with DeploymentPodReplacementPolicy", + "1 fully labelled pods and 2 terminating with DeploymentReplicaSetTerminatingReplicas", true, fullyLabelledRS, []*v1.Pod{ @@ -227,7 +227,7 @@ func TestCalculateStatus(t *testing.T) { for _, test := range rsStatusTests { t.Run(test.name, func(t *testing.T) { - featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.DeploymentPodReplacementPolicy, test.enableDeploymentPodReplacementPolicy) + featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.DeploymentReplicaSetTerminatingReplicas, test.enableDeploymentReplicaSetTerminatingReplicas) replicaSetStatus := calculateStatus(test.replicaset, test.activePods, test.terminatingPods, nil) if !reflect.DeepEqual(replicaSetStatus, test.expectedReplicaSetStatus) { diff --git a/pkg/features/kube_features.go b/pkg/features/kube_features.go index 0236c23dd46..c745d4bf482 100644 --- a/pkg/features/kube_features.go +++ b/pkg/features/kube_features.go @@ -180,7 +180,7 @@ const ( // kep: http://kep.k8s.io/3973 // // Deployments and replica sets can now also track terminating pods via .status.terminatingReplicas. - DeploymentPodReplacementPolicy featuregate.Feature = "DeploymentPodReplacementPolicy" + DeploymentReplicaSetTerminatingReplicas featuregate.Feature = "DeploymentReplicaSetTerminatingReplicas" // owner: @elezar // kep: http://kep.k8s.io/4009 @@ -1120,7 +1120,7 @@ var defaultVersionedKubernetesFeatureGates = map[featuregate.Feature]featuregate {Version: version.MustParse("1.33"), Default: false, PreRelease: featuregate.Beta}, }, - DeploymentPodReplacementPolicy: { + DeploymentReplicaSetTerminatingReplicas: { {Version: version.MustParse("1.32"), Default: false, PreRelease: featuregate.Alpha}, }, diff --git a/pkg/generated/openapi/zz_generated.openapi.go b/pkg/generated/openapi/zz_generated.openapi.go index 903421646ff..169f8581eb8 100644 --- a/pkg/generated/openapi/zz_generated.openapi.go +++ b/pkg/generated/openapi/zz_generated.openapi.go @@ -7582,7 +7582,7 @@ func schema_k8sio_api_apps_v1_DeploymentStatus(ref common.ReferenceCallback) com }, "terminatingReplicas": { SchemaProps: spec.SchemaProps{ - Description: "Total number of terminating pods targeted by this deployment. Terminating pods have a non-null .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase.\n\nThis is an alpha field. Enable DeploymentPodReplacementPolicy to be able to use this field.", + Description: "Total number of terminating pods targeted by this deployment. Terminating pods have a non-null .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase.\n\nThis is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field.", Type: []string{"integer"}, Format: "int32", }, @@ -7889,7 +7889,7 @@ func schema_k8sio_api_apps_v1_ReplicaSetStatus(ref common.ReferenceCallback) com }, "terminatingReplicas": { SchemaProps: spec.SchemaProps{ - Description: "The number of terminating pods for this replica set. Terminating pods have a non-null .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase.\n\nThis is an alpha field. Enable DeploymentPodReplacementPolicy to be able to use this field.", + Description: "The number of terminating pods for this replica set. Terminating pods have a non-null .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase.\n\nThis is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field.", Type: []string{"integer"}, Format: "int32", }, @@ -8910,7 +8910,7 @@ func schema_k8sio_api_apps_v1beta1_DeploymentStatus(ref common.ReferenceCallback }, "terminatingReplicas": { SchemaProps: spec.SchemaProps{ - Description: "Total number of terminating pods targeted by this deployment. Terminating pods have a non-null .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase.\n\nThis is an alpha field. Enable DeploymentPodReplacementPolicy to be able to use this field.", + Description: "Total number of terminating pods targeted by this deployment. Terminating pods have a non-null .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase.\n\nThis is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field.", Type: []string{"integer"}, Format: "int32", }, @@ -10332,7 +10332,7 @@ func schema_k8sio_api_apps_v1beta2_DeploymentStatus(ref common.ReferenceCallback }, "terminatingReplicas": { SchemaProps: spec.SchemaProps{ - Description: "Total number of terminating pods targeted by this deployment. Terminating pods have a non-null .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase.\n\nThis is an alpha field. Enable DeploymentPodReplacementPolicy to be able to use this field.", + Description: "Total number of terminating pods targeted by this deployment. Terminating pods have a non-null .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase.\n\nThis is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field.", Type: []string{"integer"}, Format: "int32", }, @@ -10638,7 +10638,7 @@ func schema_k8sio_api_apps_v1beta2_ReplicaSetStatus(ref common.ReferenceCallback }, "terminatingReplicas": { SchemaProps: spec.SchemaProps{ - Description: "The number of terminating pods for this replica set. Terminating pods have a non-null .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase.\n\nThis is an alpha field. Enable DeploymentPodReplacementPolicy to be able to use this field.", + Description: "The number of terminating pods for this replica set. Terminating pods have a non-null .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase.\n\nThis is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field.", Type: []string{"integer"}, Format: "int32", }, @@ -35457,7 +35457,7 @@ func schema_k8sio_api_extensions_v1beta1_DeploymentStatus(ref common.ReferenceCa }, "terminatingReplicas": { SchemaProps: spec.SchemaProps{ - Description: "Total number of terminating pods targeted by this deployment. Terminating pods have a non-null .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase.\n\nThis is an alpha field. Enable DeploymentPodReplacementPolicy to be able to use this field.", + Description: "Total number of terminating pods targeted by this deployment. Terminating pods have a non-null .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase.\n\nThis is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field.", Type: []string{"integer"}, Format: "int32", }, @@ -36658,7 +36658,7 @@ func schema_k8sio_api_extensions_v1beta1_ReplicaSetStatus(ref common.ReferenceCa }, "terminatingReplicas": { SchemaProps: spec.SchemaProps{ - Description: "The number of terminating pods for this replica set. Terminating pods have a non-null .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase.\n\nThis is an alpha field. Enable DeploymentPodReplacementPolicy to be able to use this field.", + Description: "The number of terminating pods for this replica set. Terminating pods have a non-null .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase.\n\nThis is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field.", Type: []string{"integer"}, Format: "int32", }, diff --git a/pkg/registry/apps/deployment/strategy.go b/pkg/registry/apps/deployment/strategy.go index d8ca5ef2c30..5ce19754edb 100644 --- a/pkg/registry/apps/deployment/strategy.go +++ b/pkg/registry/apps/deployment/strategy.go @@ -209,7 +209,7 @@ func (deploymentStatusStrategy) WarningsOnUpdate(ctx context.Context, obj, old r // dropDisabledStatusFields removes disabled fields from the deployment status. func dropDisabledStatusFields(deploymentStatus, oldDeploymentStatus *apps.DeploymentStatus) { - if !utilfeature.DefaultFeatureGate.Enabled(features.DeploymentPodReplacementPolicy) && + if !utilfeature.DefaultFeatureGate.Enabled(features.DeploymentReplicaSetTerminatingReplicas) && (oldDeploymentStatus == nil || oldDeploymentStatus.TerminatingReplicas == nil) { deploymentStatus.TerminatingReplicas = nil } diff --git a/pkg/registry/apps/deployment/strategy_test.go b/pkg/registry/apps/deployment/strategy_test.go index d514783765a..0534222fccd 100644 --- a/pkg/registry/apps/deployment/strategy_test.go +++ b/pkg/registry/apps/deployment/strategy_test.go @@ -66,40 +66,40 @@ func TestStatusUpdates(t *testing.T) { } } -func TestStatusUpdatesWithDeploymentPodReplacementPolicy(t *testing.T) { +func TestStatusUpdatesWithDeploymentReplicaSetTerminatingReplicas(t *testing.T) { tests := []struct { - name string - enableDeploymentPodReplacementPolicy bool - terminatingReplicas *int32 - terminatingReplicasUpdate *int32 - expectedTerminatingReplicas *int32 + name string + enableDeploymentReplicaSetTerminatingReplicas bool + terminatingReplicas *int32 + terminatingReplicasUpdate *int32 + expectedTerminatingReplicas *int32 }{ { - name: "should not allow updates when feature gate is disabled", - enableDeploymentPodReplacementPolicy: false, - terminatingReplicas: nil, - terminatingReplicasUpdate: ptr.To[int32](2), - expectedTerminatingReplicas: nil, + name: "should not allow updates when feature gate is disabled", + enableDeploymentReplicaSetTerminatingReplicas: false, + terminatingReplicas: nil, + terminatingReplicasUpdate: ptr.To[int32](2), + expectedTerminatingReplicas: nil, }, { - name: "should allow update when the field is in use when feature gate is disabled", - enableDeploymentPodReplacementPolicy: false, - terminatingReplicas: ptr.To[int32](2), - terminatingReplicasUpdate: ptr.To[int32](5), - expectedTerminatingReplicas: ptr.To[int32](5), + name: "should allow update when the field is in use when feature gate is disabled", + enableDeploymentReplicaSetTerminatingReplicas: false, + terminatingReplicas: ptr.To[int32](2), + terminatingReplicasUpdate: ptr.To[int32](5), + expectedTerminatingReplicas: ptr.To[int32](5), }, { - name: "should allow updates when feature gate is enabled", - enableDeploymentPodReplacementPolicy: true, - terminatingReplicas: nil, - terminatingReplicasUpdate: ptr.To[int32](2), - expectedTerminatingReplicas: ptr.To[int32](2), + name: "should allow updates when feature gate is enabled", + enableDeploymentReplicaSetTerminatingReplicas: true, + terminatingReplicas: nil, + terminatingReplicasUpdate: ptr.To[int32](2), + expectedTerminatingReplicas: ptr.To[int32](2), }, } for _, tc := range tests { t.Run(tc.name, func(t *testing.T) { - featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.DeploymentPodReplacementPolicy, tc.enableDeploymentPodReplacementPolicy) + featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.DeploymentReplicaSetTerminatingReplicas, tc.enableDeploymentReplicaSetTerminatingReplicas) ctx := genericapirequest.NewDefaultContext() validSelector := map[string]string{"a": "b"} diff --git a/pkg/registry/apps/replicaset/strategy.go b/pkg/registry/apps/replicaset/strategy.go index e795cc73587..fe0d26d098d 100644 --- a/pkg/registry/apps/replicaset/strategy.go +++ b/pkg/registry/apps/replicaset/strategy.go @@ -247,7 +247,7 @@ func (rsStatusStrategy) WarningsOnUpdate(ctx context.Context, obj, old runtime.O // dropDisabledStatusFields removes disabled fields from the replica set status. func dropDisabledStatusFields(rsStatus, oldRSStatus *apps.ReplicaSetStatus) { - if !utilfeature.DefaultFeatureGate.Enabled(features.DeploymentPodReplacementPolicy) && + if !utilfeature.DefaultFeatureGate.Enabled(features.DeploymentReplicaSetTerminatingReplicas) && (oldRSStatus == nil || oldRSStatus.TerminatingReplicas == nil) { rsStatus.TerminatingReplicas = nil } diff --git a/pkg/registry/apps/replicaset/strategy_test.go b/pkg/registry/apps/replicaset/strategy_test.go index 5bf8d46b326..1c8e6016f59 100644 --- a/pkg/registry/apps/replicaset/strategy_test.go +++ b/pkg/registry/apps/replicaset/strategy_test.go @@ -152,40 +152,40 @@ func TestReplicaSetStatusStrategy(t *testing.T) { } } -func TestReplicaSetStatusStrategyWithDeploymentPodReplacementPolicy(t *testing.T) { +func TestReplicaSetStatusStrategyWithDeploymentReplicaSetTerminatingReplicas(t *testing.T) { tests := []struct { - name string - enableDeploymentPodReplacementPolicy bool - terminatingReplicas *int32 - terminatingReplicasUpdate *int32 - expectedTerminatingReplicas *int32 + name string + enableDeploymentReplicaSetTerminatingReplicas bool + terminatingReplicas *int32 + terminatingReplicasUpdate *int32 + expectedTerminatingReplicas *int32 }{ { - name: "should not allow updates when feature gate is disabled", - enableDeploymentPodReplacementPolicy: false, - terminatingReplicas: nil, - terminatingReplicasUpdate: ptr.To[int32](2), - expectedTerminatingReplicas: nil, + name: "should not allow updates when feature gate is disabled", + enableDeploymentReplicaSetTerminatingReplicas: false, + terminatingReplicas: nil, + terminatingReplicasUpdate: ptr.To[int32](2), + expectedTerminatingReplicas: nil, }, { - name: "should allow update when the field is in use when feature gate is disabled", - enableDeploymentPodReplacementPolicy: false, - terminatingReplicas: ptr.To[int32](2), - terminatingReplicasUpdate: ptr.To[int32](5), - expectedTerminatingReplicas: ptr.To[int32](5), + name: "should allow update when the field is in use when feature gate is disabled", + enableDeploymentReplicaSetTerminatingReplicas: false, + terminatingReplicas: ptr.To[int32](2), + terminatingReplicasUpdate: ptr.To[int32](5), + expectedTerminatingReplicas: ptr.To[int32](5), }, { - name: "should allow updates when feature gate is enabled", - enableDeploymentPodReplacementPolicy: true, - terminatingReplicas: nil, - terminatingReplicasUpdate: ptr.To[int32](2), - expectedTerminatingReplicas: ptr.To[int32](2), + name: "should allow updates when feature gate is enabled", + enableDeploymentReplicaSetTerminatingReplicas: true, + terminatingReplicas: nil, + terminatingReplicasUpdate: ptr.To[int32](2), + expectedTerminatingReplicas: ptr.To[int32](2), }, } for _, tc := range tests { t.Run(tc.name, func(t *testing.T) { - featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.DeploymentPodReplacementPolicy, tc.enableDeploymentPodReplacementPolicy) + featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.DeploymentReplicaSetTerminatingReplicas, tc.enableDeploymentReplicaSetTerminatingReplicas) ctx := genericapirequest.NewDefaultContext() validSelector := map[string]string{"a": "b"} diff --git a/staging/src/k8s.io/api/apps/v1/generated.proto b/staging/src/k8s.io/api/apps/v1/generated.proto index ac57a15d3e3..38c8997e994 100644 --- a/staging/src/k8s.io/api/apps/v1/generated.proto +++ b/staging/src/k8s.io/api/apps/v1/generated.proto @@ -343,7 +343,7 @@ message DeploymentStatus { // Total number of terminating pods targeted by this deployment. Terminating pods have a non-null // .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase. // - // This is an alpha field. Enable DeploymentPodReplacementPolicy to be able to use this field. + // This is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field. // +optional optional int32 terminatingReplicas = 9; @@ -481,7 +481,7 @@ message ReplicaSetStatus { // The number of terminating pods for this replica set. Terminating pods have a non-null .metadata.deletionTimestamp // and have not yet reached the Failed or Succeeded .status.phase. // - // This is an alpha field. Enable DeploymentPodReplacementPolicy to be able to use this field. + // This is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field. // +optional optional int32 terminatingReplicas = 7; diff --git a/staging/src/k8s.io/api/apps/v1/types.go b/staging/src/k8s.io/api/apps/v1/types.go index 7368e8ebb47..1362d875d88 100644 --- a/staging/src/k8s.io/api/apps/v1/types.go +++ b/staging/src/k8s.io/api/apps/v1/types.go @@ -512,7 +512,7 @@ type DeploymentStatus struct { // Total number of terminating pods targeted by this deployment. Terminating pods have a non-null // .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase. // - // This is an alpha field. Enable DeploymentPodReplacementPolicy to be able to use this field. + // This is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field. // +optional TerminatingReplicas *int32 `json:"terminatingReplicas,omitempty" protobuf:"varint,9,opt,name=terminatingReplicas"` @@ -900,7 +900,7 @@ type ReplicaSetStatus struct { // The number of terminating pods for this replica set. Terminating pods have a non-null .metadata.deletionTimestamp // and have not yet reached the Failed or Succeeded .status.phase. // - // This is an alpha field. Enable DeploymentPodReplacementPolicy to be able to use this field. + // This is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field. // +optional TerminatingReplicas *int32 `json:"terminatingReplicas,omitempty" protobuf:"varint,7,opt,name=terminatingReplicas"` diff --git a/staging/src/k8s.io/api/apps/v1/types_swagger_doc_generated.go b/staging/src/k8s.io/api/apps/v1/types_swagger_doc_generated.go index d9c3399c68f..f44ba7bc332 100644 --- a/staging/src/k8s.io/api/apps/v1/types_swagger_doc_generated.go +++ b/staging/src/k8s.io/api/apps/v1/types_swagger_doc_generated.go @@ -182,7 +182,7 @@ var map_DeploymentStatus = map[string]string{ "readyReplicas": "Total number of non-terminating pods targeted by this Deployment with a Ready Condition.", "availableReplicas": "Total number of available non-terminating pods (ready for at least minReadySeconds) targeted by this deployment.", "unavailableReplicas": "Total number of unavailable pods targeted by this deployment. This is the total number of pods that are still required for the deployment to have 100% available capacity. They may either be pods that are running but not yet available or pods that still have not been created.", - "terminatingReplicas": "Total number of terminating pods targeted by this deployment. Terminating pods have a non-null .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase.\n\nThis is an alpha field. Enable DeploymentPodReplacementPolicy to be able to use this field.", + "terminatingReplicas": "Total number of terminating pods targeted by this deployment. Terminating pods have a non-null .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase.\n\nThis is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field.", "conditions": "Represents the latest available observations of a deployment's current state.", "collisionCount": "Count of hash collisions for the Deployment. The Deployment controller uses this field as a collision avoidance mechanism when it needs to create the name for the newest ReplicaSet.", } @@ -253,7 +253,7 @@ var map_ReplicaSetStatus = map[string]string{ "fullyLabeledReplicas": "The number of non-terminating pods that have labels matching the labels of the pod template of the replicaset.", "readyReplicas": "The number of non-terminating pods targeted by this ReplicaSet with a Ready Condition.", "availableReplicas": "The number of available non-terminating pods (ready for at least minReadySeconds) for this replica set.", - "terminatingReplicas": "The number of terminating pods for this replica set. Terminating pods have a non-null .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase.\n\nThis is an alpha field. Enable DeploymentPodReplacementPolicy to be able to use this field.", + "terminatingReplicas": "The number of terminating pods for this replica set. Terminating pods have a non-null .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase.\n\nThis is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field.", "observedGeneration": "ObservedGeneration reflects the generation of the most recently observed ReplicaSet.", "conditions": "Represents the latest available observations of a replica set's current state.", } diff --git a/staging/src/k8s.io/api/apps/v1beta1/generated.proto b/staging/src/k8s.io/api/apps/v1beta1/generated.proto index 74b3ce54999..0601efc3c47 100644 --- a/staging/src/k8s.io/api/apps/v1beta1/generated.proto +++ b/staging/src/k8s.io/api/apps/v1beta1/generated.proto @@ -208,7 +208,7 @@ message DeploymentStatus { // Total number of terminating pods targeted by this deployment. Terminating pods have a non-null // .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase. // - // This is an alpha field. Enable DeploymentPodReplacementPolicy to be able to use this field. + // This is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field. // +optional optional int32 terminatingReplicas = 9; diff --git a/staging/src/k8s.io/api/apps/v1beta1/types.go b/staging/src/k8s.io/api/apps/v1beta1/types.go index b97a050bfde..5530c990daa 100644 --- a/staging/src/k8s.io/api/apps/v1beta1/types.go +++ b/staging/src/k8s.io/api/apps/v1beta1/types.go @@ -578,7 +578,7 @@ type DeploymentStatus struct { // Total number of terminating pods targeted by this deployment. Terminating pods have a non-null // .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase. // - // This is an alpha field. Enable DeploymentPodReplacementPolicy to be able to use this field. + // This is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field. // +optional TerminatingReplicas *int32 `json:"terminatingReplicas,omitempty" protobuf:"varint,9,opt,name=terminatingReplicas"` diff --git a/staging/src/k8s.io/api/apps/v1beta1/types_swagger_doc_generated.go b/staging/src/k8s.io/api/apps/v1beta1/types_swagger_doc_generated.go index 436f9046f44..02ea5f7f26e 100644 --- a/staging/src/k8s.io/api/apps/v1beta1/types_swagger_doc_generated.go +++ b/staging/src/k8s.io/api/apps/v1beta1/types_swagger_doc_generated.go @@ -119,7 +119,7 @@ var map_DeploymentStatus = map[string]string{ "readyReplicas": "Total number of non-terminating pods targeted by this Deployment with a Ready Condition.", "availableReplicas": "Total number of available non-terminating pods (ready for at least minReadySeconds) targeted by this deployment.", "unavailableReplicas": "Total number of unavailable pods targeted by this deployment. This is the total number of pods that are still required for the deployment to have 100% available capacity. They may either be pods that are running but not yet available or pods that still have not been created.", - "terminatingReplicas": "Total number of terminating pods targeted by this deployment. Terminating pods have a non-null .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase.\n\nThis is an alpha field. Enable DeploymentPodReplacementPolicy to be able to use this field.", + "terminatingReplicas": "Total number of terminating pods targeted by this deployment. Terminating pods have a non-null .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase.\n\nThis is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field.", "conditions": "Represents the latest available observations of a deployment's current state.", "collisionCount": "collisionCount is the count of hash collisions for the Deployment. The Deployment controller uses this field as a collision avoidance mechanism when it needs to create the name for the newest ReplicaSet.", } diff --git a/staging/src/k8s.io/api/apps/v1beta2/generated.proto b/staging/src/k8s.io/api/apps/v1beta2/generated.proto index b0d4e3f0894..68c463e2570 100644 --- a/staging/src/k8s.io/api/apps/v1beta2/generated.proto +++ b/staging/src/k8s.io/api/apps/v1beta2/generated.proto @@ -348,7 +348,7 @@ message DeploymentStatus { // Total number of terminating pods targeted by this deployment. Terminating pods have a non-null // .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase. // - // This is an alpha field. Enable DeploymentPodReplacementPolicy to be able to use this field. + // This is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field. // +optional optional int32 terminatingReplicas = 9; @@ -487,7 +487,7 @@ message ReplicaSetStatus { // The number of terminating pods for this replica set. Terminating pods have a non-null .metadata.deletionTimestamp // and have not yet reached the Failed or Succeeded .status.phase. // - // This is an alpha field. Enable DeploymentPodReplacementPolicy to be able to use this field. + // This is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field. // +optional optional int32 terminatingReplicas = 7; diff --git a/staging/src/k8s.io/api/apps/v1beta2/types.go b/staging/src/k8s.io/api/apps/v1beta2/types.go index 2d88bfba534..491afc59f5b 100644 --- a/staging/src/k8s.io/api/apps/v1beta2/types.go +++ b/staging/src/k8s.io/api/apps/v1beta2/types.go @@ -556,7 +556,7 @@ type DeploymentStatus struct { // Total number of terminating pods targeted by this deployment. Terminating pods have a non-null // .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase. // - // This is an alpha field. Enable DeploymentPodReplacementPolicy to be able to use this field. + // This is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field. // +optional TerminatingReplicas *int32 `json:"terminatingReplicas,omitempty" protobuf:"varint,9,opt,name=terminatingReplicas"` @@ -958,7 +958,7 @@ type ReplicaSetStatus struct { // The number of terminating pods for this replica set. Terminating pods have a non-null .metadata.deletionTimestamp // and have not yet reached the Failed or Succeeded .status.phase. // - // This is an alpha field. Enable DeploymentPodReplacementPolicy to be able to use this field. + // This is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field. // +optional TerminatingReplicas *int32 `json:"terminatingReplicas,omitempty" protobuf:"varint,7,opt,name=terminatingReplicas"` diff --git a/staging/src/k8s.io/api/apps/v1beta2/types_swagger_doc_generated.go b/staging/src/k8s.io/api/apps/v1beta2/types_swagger_doc_generated.go index d559da4dee8..40894341510 100644 --- a/staging/src/k8s.io/api/apps/v1beta2/types_swagger_doc_generated.go +++ b/staging/src/k8s.io/api/apps/v1beta2/types_swagger_doc_generated.go @@ -182,7 +182,7 @@ var map_DeploymentStatus = map[string]string{ "readyReplicas": "Total number of non-terminating pods targeted by this Deployment with a Ready Condition.", "availableReplicas": "Total number of available non-terminating pods (ready for at least minReadySeconds) targeted by this deployment.", "unavailableReplicas": "Total number of unavailable pods targeted by this deployment. This is the total number of pods that are still required for the deployment to have 100% available capacity. They may either be pods that are running but not yet available or pods that still have not been created.", - "terminatingReplicas": "Total number of terminating pods targeted by this deployment. Terminating pods have a non-null .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase.\n\nThis is an alpha field. Enable DeploymentPodReplacementPolicy to be able to use this field.", + "terminatingReplicas": "Total number of terminating pods targeted by this deployment. Terminating pods have a non-null .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase.\n\nThis is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field.", "conditions": "Represents the latest available observations of a deployment's current state.", "collisionCount": "Count of hash collisions for the Deployment. The Deployment controller uses this field as a collision avoidance mechanism when it needs to create the name for the newest ReplicaSet.", } @@ -253,7 +253,7 @@ var map_ReplicaSetStatus = map[string]string{ "fullyLabeledReplicas": "The number of non-terminating pods that have labels matching the labels of the pod template of the replicaset.", "readyReplicas": "The number of non-terminating pods targeted by this ReplicaSet with a Ready Condition.", "availableReplicas": "The number of available non-terminating pods (ready for at least minReadySeconds) for this replica set.", - "terminatingReplicas": "The number of terminating pods for this replica set. Terminating pods have a non-null .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase.\n\nThis is an alpha field. Enable DeploymentPodReplacementPolicy to be able to use this field.", + "terminatingReplicas": "The number of terminating pods for this replica set. Terminating pods have a non-null .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase.\n\nThis is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field.", "observedGeneration": "ObservedGeneration reflects the generation of the most recently observed ReplicaSet.", "conditions": "Represents the latest available observations of a replica set's current state.", } diff --git a/staging/src/k8s.io/api/extensions/v1beta1/generated.proto b/staging/src/k8s.io/api/extensions/v1beta1/generated.proto index ef087c2423b..70fcec0cc57 100644 --- a/staging/src/k8s.io/api/extensions/v1beta1/generated.proto +++ b/staging/src/k8s.io/api/extensions/v1beta1/generated.proto @@ -345,7 +345,7 @@ message DeploymentStatus { // Total number of terminating pods targeted by this deployment. Terminating pods have a non-null // .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase. // - // This is an alpha field. Enable DeploymentPodReplacementPolicy to be able to use this field. + // This is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field. // +optional optional int32 terminatingReplicas = 9; @@ -924,7 +924,7 @@ message ReplicaSetStatus { // The number of terminating pods for this replica set. Terminating pods have a non-null .metadata.deletionTimestamp // and have not yet reached the Failed or Succeeded .status.phase. // - // This is an alpha field. Enable DeploymentPodReplacementPolicy to be able to use this field. + // This is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field. // +optional optional int32 terminatingReplicas = 7; diff --git a/staging/src/k8s.io/api/extensions/v1beta1/types.go b/staging/src/k8s.io/api/extensions/v1beta1/types.go index 58bec631869..b80a7a7e16b 100644 --- a/staging/src/k8s.io/api/extensions/v1beta1/types.go +++ b/staging/src/k8s.io/api/extensions/v1beta1/types.go @@ -270,7 +270,7 @@ type DeploymentStatus struct { // Total number of terminating pods targeted by this deployment. Terminating pods have a non-null // .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase. // - // This is an alpha field. Enable DeploymentPodReplacementPolicy to be able to use this field. + // This is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field. // +optional TerminatingReplicas *int32 `json:"terminatingReplicas,omitempty" protobuf:"varint,9,opt,name=terminatingReplicas"` @@ -1002,7 +1002,7 @@ type ReplicaSetStatus struct { // The number of terminating pods for this replica set. Terminating pods have a non-null .metadata.deletionTimestamp // and have not yet reached the Failed or Succeeded .status.phase. // - // This is an alpha field. Enable DeploymentPodReplacementPolicy to be able to use this field. + // This is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field. // +optional TerminatingReplicas *int32 `json:"terminatingReplicas,omitempty" protobuf:"varint,7,opt,name=terminatingReplicas"` diff --git a/staging/src/k8s.io/api/extensions/v1beta1/types_swagger_doc_generated.go b/staging/src/k8s.io/api/extensions/v1beta1/types_swagger_doc_generated.go index 33f639327fa..923fab3aa1d 100644 --- a/staging/src/k8s.io/api/extensions/v1beta1/types_swagger_doc_generated.go +++ b/staging/src/k8s.io/api/extensions/v1beta1/types_swagger_doc_generated.go @@ -174,7 +174,7 @@ var map_DeploymentStatus = map[string]string{ "readyReplicas": "Total number of non-terminating pods targeted by this Deployment with a Ready Condition.", "availableReplicas": "Total number of available non-terminating pods (ready for at least minReadySeconds) targeted by this deployment.", "unavailableReplicas": "Total number of unavailable pods targeted by this deployment. This is the total number of pods that are still required for the deployment to have 100% available capacity. They may either be pods that are running but not yet available or pods that still have not been created.", - "terminatingReplicas": "Total number of terminating pods targeted by this deployment. Terminating pods have a non-null .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase.\n\nThis is an alpha field. Enable DeploymentPodReplacementPolicy to be able to use this field.", + "terminatingReplicas": "Total number of terminating pods targeted by this deployment. Terminating pods have a non-null .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase.\n\nThis is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field.", "conditions": "Represents the latest available observations of a deployment's current state.", "collisionCount": "Count of hash collisions for the Deployment. The Deployment controller uses this field as a collision avoidance mechanism when it needs to create the name for the newest ReplicaSet.", } @@ -461,7 +461,7 @@ var map_ReplicaSetStatus = map[string]string{ "fullyLabeledReplicas": "The number of non-terminating pods that have labels matching the labels of the pod template of the replicaset.", "readyReplicas": "The number of non-terminating pods targeted by this ReplicaSet with a Ready Condition.", "availableReplicas": "The number of available non-terminating pods (ready for at least minReadySeconds) for this replica set.", - "terminatingReplicas": "The number of terminating pods for this replica set. Terminating pods have a non-null .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase.\n\nThis is an alpha field. Enable DeploymentPodReplacementPolicy to be able to use this field.", + "terminatingReplicas": "The number of terminating pods for this replica set. Terminating pods have a non-null .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase.\n\nThis is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field.", "observedGeneration": "ObservedGeneration reflects the generation of the most recently observed ReplicaSet.", "conditions": "Represents the latest available observations of a replica set's current state.", } diff --git a/test/compatibility_lifecycle/reference/versioned_feature_list.yaml b/test/compatibility_lifecycle/reference/versioned_feature_list.yaml index fecd1142a72..07b95001c85 100644 --- a/test/compatibility_lifecycle/reference/versioned_feature_list.yaml +++ b/test/compatibility_lifecycle/reference/versioned_feature_list.yaml @@ -379,7 +379,7 @@ lockToDefault: false preRelease: Beta version: "1.33" -- name: DeploymentPodReplacementPolicy +- name: DeploymentReplicaSetTerminatingReplicas versionedSpecs: - default: false lockToDefault: false diff --git a/test/integration/deployment/deployment_test.go b/test/integration/deployment/deployment_test.go index 11748383eff..a53e141b94f 100644 --- a/test/integration/deployment/deployment_test.go +++ b/test/integration/deployment/deployment_test.go @@ -1308,7 +1308,7 @@ func TestReplicaSetOrphaningAndAdoptionWhenLabelsChange(t *testing.T) { } func TestTerminatingReplicasDeploymentStatus(t *testing.T) { - featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.DeploymentPodReplacementPolicy, false) + featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.DeploymentReplicaSetTerminatingReplicas, false) _, ctx := ktesting.NewTestContext(t) ctx, cancel := context.WithCancel(ctx) @@ -1366,7 +1366,7 @@ func TestTerminatingReplicasDeploymentStatus(t *testing.T) { } // should update terminating replicas when feature gate is enabled - featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.DeploymentPodReplacementPolicy, true) + featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.DeploymentReplicaSetTerminatingReplicas, true) // Scale down the deployment tester.deployment, err = tester.updateDeployment(func(update *apps.Deployment) { update.Spec.Replicas = ptr.To(int32(3)) @@ -1384,7 +1384,7 @@ func TestTerminatingReplicasDeploymentStatus(t *testing.T) { } // should not update terminating replicas when feature gate is disabled - featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.DeploymentPodReplacementPolicy, false) + featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.DeploymentReplicaSetTerminatingReplicas, false) // Scale down the deployment tester.deployment, err = tester.updateDeployment(func(update *apps.Deployment) { update.Spec.Replicas = ptr.To(int32(2)) diff --git a/test/integration/replicaset/replicaset_test.go b/test/integration/replicaset/replicaset_test.go index 96a6b4cc96e..48918a28dde 100644 --- a/test/integration/replicaset/replicaset_test.go +++ b/test/integration/replicaset/replicaset_test.go @@ -1072,7 +1072,7 @@ func TestReplicaSetsAppsV1DefaultGCPolicy(t *testing.T) { } func TestTerminatingReplicas(t *testing.T) { - featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.DeploymentPodReplacementPolicy, false) + featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.DeploymentReplicaSetTerminatingReplicas, false) tCtx, closeFn, rm, informers, c := rmSetup(t) defer closeFn() @@ -1108,7 +1108,7 @@ func TestTerminatingReplicas(t *testing.T) { } // should update terminating pods when feature gate is enabled - featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.DeploymentPodReplacementPolicy, true) + featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.DeploymentReplicaSetTerminatingReplicas, true) if err := podClient.Delete(tCtx, pods.Items[1].Name, metav1.DeleteOptions{}); err != nil { t.Fatal(err) } @@ -1125,7 +1125,7 @@ func TestTerminatingReplicas(t *testing.T) { } // should revert terminating pods to 0 when feature gate is disabled - featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.DeploymentPodReplacementPolicy, false) + featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.DeploymentReplicaSetTerminatingReplicas, false) if err := podClient.Delete(tCtx, pods.Items[2].Name, metav1.DeleteOptions{}); err != nil { t.Fatal(err) }