Skip to content

Commit 9c1392d

Browse files
authored
Merge pull request #12232 from sbueringer/pr-remove-md-progress-deadline
⚠️ Remove MD spec.progressDeadlineSeconds
2 parents d9033b3 + bf195d9 commit 9c1392d

17 files changed

+63
-87
lines changed

.golangci.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -245,10 +245,6 @@ linters:
245245
- linters:
246246
- staticcheck
247247
text: 'SA1019: ((deployment|m|md).Spec.RevisionHistoryLimit|clusterv1.RevisionHistoryAnnotation|c.RolloutUndo) is deprecated'
248-
# Deprecations for MD revision management
249-
- linters:
250-
- staticcheck
251-
text: 'SA1019: (m|md).Spec.ProgressDeadlineSeconds is deprecated: This field is deprecated and is going to be removed in the next apiVersion. Please see https://github.com/kubernetes-sigs/cluster-api/issues/11470 for more details.'
252248
# Deprecations for MHC MaxUnhealthy, UnhealthyRange
253249
- linters:
254250
- staticcheck

api/v1beta1/conversion.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,11 @@ func Convert_v1beta2_Topology_To_v1beta1_Topology(in *clusterv1.Topology, out *T
359359
return nil
360360
}
361361

362+
func Convert_v1beta1_MachineDeploymentSpec_To_v1beta2_MachineDeploymentSpec(in *MachineDeploymentSpec, out *clusterv1.MachineDeploymentSpec, s apimachineryconversion.Scope) error {
363+
// NOTE: v1beta2 MachineDeploymentSpec does not have ProgressDeadlineSeconds anymore. But it's fine to just lose this field it was never used.
364+
return autoConvert_v1beta1_MachineDeploymentSpec_To_v1beta2_MachineDeploymentSpec(in, out, s)
365+
}
366+
362367
func Convert_v1beta2_MachineDeploymentStatus_To_v1beta1_MachineDeploymentStatus(in *clusterv1.MachineDeploymentStatus, out *MachineDeploymentStatus, s apimachineryconversion.Scope) error {
363368
if err := autoConvert_v1beta2_MachineDeploymentStatus_To_v1beta1_MachineDeploymentStatus(in, out, s); err != nil {
364369
return err

api/v1beta1/conversion_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,7 @@ func spokeMachineSetStatus(in *MachineSetStatus, c fuzz.Continue) {
290290
func MachineDeploymentFuzzFuncs(_ runtimeserializer.CodecFactory) []interface{} {
291291
return []interface{}{
292292
hubMachineDeploymentStatus,
293+
spokeMachineDeploymentSpec,
293294
spokeMachineDeploymentStatus,
294295
}
295296
}
@@ -305,6 +306,13 @@ func hubMachineDeploymentStatus(in *clusterv1.MachineDeploymentStatus, c fuzz.Co
305306
}
306307
}
307308

309+
func spokeMachineDeploymentSpec(in *MachineDeploymentSpec, c fuzz.Continue) {
310+
c.FuzzNoCustom(in)
311+
312+
// Drop ProgressDeadlineSeconds as we intentionally don't preserve it.
313+
in.ProgressDeadlineSeconds = nil
314+
}
315+
308316
func spokeMachineDeploymentStatus(in *MachineDeploymentStatus, c fuzz.Continue) {
309317
c.FuzzNoCustom(in)
310318
// Drop empty structs with only omit empty fields.

api/v1beta1/zz_generated.conversion.go

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

api/v1beta2/machinedeployment_types.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -312,17 +312,6 @@ type MachineDeploymentSpec struct {
312312
// paused indicates that the deployment is paused.
313313
// +optional
314314
Paused bool `json:"paused,omitempty"`
315-
316-
// progressDeadlineSeconds is the maximum time in seconds for a deployment to make progress before it
317-
// is considered to be failed. The deployment controller will continue to
318-
// process failed deployments and a condition with a ProgressDeadlineExceeded
319-
// reason will be surfaced in the deployment status. Note that progress will
320-
// not be estimated during the time a deployment is paused. Defaults to 600s.
321-
//
322-
// Deprecated: This field is deprecated and is going to be removed in the next apiVersion. Please see https://github.com/kubernetes-sigs/cluster-api/issues/11470 for more details.
323-
//
324-
// +optional
325-
ProgressDeadlineSeconds *int32 `json:"progressDeadlineSeconds,omitempty"`
326315
}
327316

328317
// ANCHOR_END: MachineDeploymentSpec

api/v1beta2/zz_generated.deepcopy.go

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

api/v1beta2/zz_generated.openapi.go

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

config/crd/bases/cluster.x-k8s.io_machinedeployments.yaml

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

internal/apis/core/v1alpha3/conversion.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,11 @@ func Convert_v1beta2_MachineSetSpec_To_v1alpha3_MachineSetSpec(in *clusterv1.Mac
531531
return autoConvert_v1beta2_MachineSetSpec_To_v1alpha3_MachineSetSpec(in, out, s)
532532
}
533533

534+
func Convert_v1alpha3_MachineDeploymentSpec_To_v1beta2_MachineDeploymentSpec(in *MachineDeploymentSpec, out *clusterv1.MachineDeploymentSpec, s apimachineryconversion.Scope) error {
535+
// NOTE: v1beta2 MachineDeploymentSpec does not have ProgressDeadlineSeconds anymore. But it's fine to just lose this field it was never used.
536+
return autoConvert_v1alpha3_MachineDeploymentSpec_To_v1beta2_MachineDeploymentSpec(in, out, s)
537+
}
538+
534539
func Convert_v1alpha3_MachineDeploymentStatus_To_v1beta2_MachineDeploymentStatus(in *MachineDeploymentStatus, out *clusterv1.MachineDeploymentStatus, s apimachineryconversion.Scope) error {
535540
return autoConvert_v1alpha3_MachineDeploymentStatus_To_v1beta2_MachineDeploymentStatus(in, out, s)
536541
}

internal/apis/core/v1alpha3/conversion_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ func hubMachineSetStatus(in *clusterv1.MachineSetStatus, c fuzz.Continue) {
122122
func MachineDeploymentFuzzFunc(_ runtimeserializer.CodecFactory) []interface{} {
123123
return []interface{}{
124124
hubMachineDeploymentStatus,
125+
spokeMachineDeploymentSpec,
125126
spokeObjectMeta,
126127
spokeBootstrap,
127128
}
@@ -138,6 +139,13 @@ func hubMachineDeploymentStatus(in *clusterv1.MachineDeploymentStatus, c fuzz.Co
138139
}
139140
}
140141

142+
func spokeMachineDeploymentSpec(in *MachineDeploymentSpec, c fuzz.Continue) {
143+
c.FuzzNoCustom(in)
144+
145+
// Drop ProgressDeadlineSeconds as we intentionally don't preserve it.
146+
in.ProgressDeadlineSeconds = nil
147+
}
148+
141149
func spokeObjectMeta(in *ObjectMeta, c fuzz.Continue) {
142150
c.FuzzNoCustom(in)
143151

0 commit comments

Comments
 (0)