Skip to content

Commit 8db1426

Browse files
committed
rename DeploymentPodReplacementPolicy FG to DeploymentReplicaSetTerminatingReplicas
1 parent 83bb5d5 commit 8db1426

30 files changed

+112
-112
lines changed

CHANGELOG/CHANGELOG-1.33.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,7 @@ name | architectures
614614

615615
### API Change
616616

617-
- 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]
617+
- 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]
618618
- 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]
619619
- 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]
620620
- 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]

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/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.

pkg/apis/apps/types.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ type DeploymentStatus struct {
533533
// Total number of terminating pods targeted by this deployment. Terminating pods have a non-null
534534
// .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase.
535535
//
536-
// This is an alpha field. Enable DeploymentPodReplacementPolicy to be able to use this field.
536+
// This is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field.
537537
// +optional
538538
TerminatingReplicas *int32
539539

@@ -892,7 +892,7 @@ type ReplicaSetStatus struct {
892892
// The number of terminating pods for this replica set. Terminating pods have a non-null .metadata.deletionTimestamp
893893
// and have not yet reached the Failed or Succeeded .status.phase.
894894
//
895-
// This is an alpha field. Enable DeploymentPodReplacementPolicy to be able to use this field.
895+
// This is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field.
896896
// +optional
897897
TerminatingReplicas *int32
898898

pkg/controller/deployment/sync.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ func calculateStatus(allRSs []*apps.ReplicaSet, newRS *apps.ReplicaSet, deployme
506506
UnavailableReplicas: unavailableReplicas,
507507
CollisionCount: deployment.Status.CollisionCount,
508508
}
509-
if utilfeature.DefaultFeatureGate.Enabled(features.DeploymentPodReplacementPolicy) {
509+
if utilfeature.DefaultFeatureGate.Enabled(features.DeploymentReplicaSetTerminatingReplicas) {
510510
status.TerminatingReplicas = deploymentutil.GetTerminatingReplicaCountForReplicaSets(allRSs)
511511
}
512512

pkg/controller/deployment/util/deployment_util_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1455,14 +1455,14 @@ func TestMinAvailable(t *testing.T) {
14551455

14561456
func TestGetReplicaSetFraction(t *testing.T) {
14571457
tests := []struct {
1458-
name string
1459-
enableDeploymentPodReplacementPolicy bool
1460-
deploymentReplicas int32
1461-
deploymentStatusReplicas int32
1462-
deploymentMaxSurge int32
1463-
rsReplicas int32
1464-
rsAnnotations map[string]string
1465-
expectedFraction int32
1458+
name string
1459+
enableDeploymentReplicaSetTerminatingReplicas bool
1460+
deploymentReplicas int32
1461+
deploymentStatusReplicas int32
1462+
deploymentMaxSurge int32
1463+
rsReplicas int32
1464+
rsAnnotations map[string]string
1465+
expectedFraction int32
14661466
}{
14671467
{
14681468
name: "empty deployment always scales to 0",

pkg/controller/replicaset/replica_set.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,7 @@ func (rsc *ReplicaSetController) syncReplicaSet(ctx context.Context, key string)
719719
}
720720

721721
var terminatingPods []*v1.Pod
722-
if utilfeature.DefaultFeatureGate.Enabled(features.DeploymentPodReplacementPolicy) {
722+
if utilfeature.DefaultFeatureGate.Enabled(features.DeploymentReplicaSetTerminatingReplicas) {
723723
allTerminatingPods := controller.FilterTerminatingPods(allPods)
724724
terminatingPods = controller.FilterClaimedPods(rs, selector, allTerminatingPods)
725725
}

pkg/controller/replicaset/replica_set_utils.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ func updateReplicaSetStatus(logger klog.Logger, c appsclient.ReplicaSetInterface
6161
var updatedRS *apps.ReplicaSet
6262
for i, rs := 0, rs; ; i++ {
6363
terminatingReplicasUpdateInfo := ""
64-
if utilfeature.DefaultFeatureGate.Enabled(features.DeploymentPodReplacementPolicy) {
64+
if utilfeature.DefaultFeatureGate.Enabled(features.DeploymentReplicaSetTerminatingReplicas) {
6565
terminatingReplicasUpdateInfo = fmt.Sprintf("terminatingReplicas %s->%s, ", derefInt32ToStr(rs.Status.TerminatingReplicas), derefInt32ToStr(newStatus.TerminatingReplicas))
6666
}
6767
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
116116
}
117117

118118
var terminatingReplicasCount *int32
119-
if utilfeature.DefaultFeatureGate.Enabled(features.DeploymentPodReplacementPolicy) {
119+
if utilfeature.DefaultFeatureGate.Enabled(features.DeploymentReplicaSetTerminatingReplicas) {
120120
terminatingReplicasCount = ptr.To(int32(len(terminatingPods)))
121121
}
122122

pkg/controller/replicaset/replica_set_utils_test.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@ func TestCalculateStatus(t *testing.T) {
4747
}
4848

4949
rsStatusTests := []struct {
50-
name string
51-
enableDeploymentPodReplacementPolicy bool
52-
replicaset *apps.ReplicaSet
53-
activePods []*v1.Pod
54-
terminatingPods []*v1.Pod
55-
expectedReplicaSetStatus apps.ReplicaSetStatus
50+
name string
51+
enableDeploymentReplicaSetTerminatingReplicas bool
52+
replicaset *apps.ReplicaSet
53+
activePods []*v1.Pod
54+
terminatingPods []*v1.Pod
55+
expectedReplicaSetStatus apps.ReplicaSetStatus
5656
}{
5757
{
5858
"1 fully labelled pod",
@@ -104,7 +104,7 @@ func TestCalculateStatus(t *testing.T) {
104104
},
105105
},
106106
{
107-
"2 fully labelled pods with DeploymentPodReplacementPolicy",
107+
"2 fully labelled pods with DeploymentReplicaSetTerminatingReplicas",
108108
true,
109109
fullyLabelledRS,
110110
[]*v1.Pod{
@@ -187,7 +187,7 @@ func TestCalculateStatus(t *testing.T) {
187187
},
188188
},
189189
{
190-
"1 fully labelled pod and 1 terminating without DeploymentPodReplacementPolicy",
190+
"1 fully labelled pod and 1 terminating without DeploymentReplicaSetTerminatingReplicas",
191191
false,
192192
fullyLabelledRS,
193193
[]*v1.Pod{
@@ -205,7 +205,7 @@ func TestCalculateStatus(t *testing.T) {
205205
},
206206
},
207207
{
208-
"1 fully labelled pods and 2 terminating with DeploymentPodReplacementPolicy",
208+
"1 fully labelled pods and 2 terminating with DeploymentReplicaSetTerminatingReplicas",
209209
true,
210210
fullyLabelledRS,
211211
[]*v1.Pod{
@@ -227,7 +227,7 @@ func TestCalculateStatus(t *testing.T) {
227227

228228
for _, test := range rsStatusTests {
229229
t.Run(test.name, func(t *testing.T) {
230-
featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.DeploymentPodReplacementPolicy, test.enableDeploymentPodReplacementPolicy)
230+
featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.DeploymentReplicaSetTerminatingReplicas, test.enableDeploymentReplicaSetTerminatingReplicas)
231231

232232
replicaSetStatus := calculateStatus(test.replicaset, test.activePods, test.terminatingPods, nil)
233233
if !reflect.DeepEqual(replicaSetStatus, test.expectedReplicaSetStatus) {

pkg/features/kube_features.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ const (
180180
// kep: http://kep.k8s.io/3973
181181
//
182182
// Deployments and replica sets can now also track terminating pods via .status.terminatingReplicas.
183-
DeploymentPodReplacementPolicy featuregate.Feature = "DeploymentPodReplacementPolicy"
183+
DeploymentReplicaSetTerminatingReplicas featuregate.Feature = "DeploymentReplicaSetTerminatingReplicas"
184184

185185
// owner: @elezar
186186
// kep: http://kep.k8s.io/4009
@@ -1120,7 +1120,7 @@ var defaultVersionedKubernetesFeatureGates = map[featuregate.Feature]featuregate
11201120
{Version: version.MustParse("1.33"), Default: false, PreRelease: featuregate.Beta},
11211121
},
11221122

1123-
DeploymentPodReplacementPolicy: {
1123+
DeploymentReplicaSetTerminatingReplicas: {
11241124
{Version: version.MustParse("1.32"), Default: false, PreRelease: featuregate.Alpha},
11251125
},
11261126

pkg/generated/openapi/zz_generated.openapi.go

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

pkg/registry/apps/deployment/strategy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ func (deploymentStatusStrategy) WarningsOnUpdate(ctx context.Context, obj, old r
209209

210210
// dropDisabledStatusFields removes disabled fields from the deployment status.
211211
func dropDisabledStatusFields(deploymentStatus, oldDeploymentStatus *apps.DeploymentStatus) {
212-
if !utilfeature.DefaultFeatureGate.Enabled(features.DeploymentPodReplacementPolicy) &&
212+
if !utilfeature.DefaultFeatureGate.Enabled(features.DeploymentReplicaSetTerminatingReplicas) &&
213213
(oldDeploymentStatus == nil || oldDeploymentStatus.TerminatingReplicas == nil) {
214214
deploymentStatus.TerminatingReplicas = nil
215215
}

0 commit comments

Comments
 (0)