Skip to content

Commit dc8b48f

Browse files
authored
Merge pull request #10855 from sbueringer/pr-deprecate-md-revision-mgmt
🌱 Deprecate MachineDeployment revision management
2 parents 6aff954 + 76ba520 commit dc8b48f

File tree

6 files changed

+18
-2
lines changed

6 files changed

+18
-2
lines changed

.golangci.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,11 @@ issues:
235235
- linters:
236236
- staticcheck
237237
text: "SA1019: (bootstrapv1.ClusterStatus|KubeadmConfigSpec.UseExperimentalRetryJoin|scope.Config.Spec.UseExperimentalRetryJoin|DockerMachine.Spec.Bootstrapped|machineStatus.Bootstrapped|c.TopologyPlan|clusterv1.ClusterClassVariableMetadata|(variable|currentDefinition|specVar|newVariableDefinition|statusVarDefinition).Metadata) is deprecated"
238-
# Deprecations for MHC MaxUnhealthy, UnhealthyRange
238+
# Deprecations for MD revision management
239+
- linters:
240+
- staticcheck
241+
text: "SA1019: (deployment|m|md)(.Spec.RevisionHistoryLimit)|clusterv1.RevisionHistoryAnnotation|c.RolloutUndo is deprecated"
242+
# Deprecations for MHC MaxUnhealthy, UnhealthyRange
239243
- linters:
240244
- staticcheck
241245
text: "SA1019: (mhc|m)(.Spec.MaxUnhealthy|.Spec.UnhealthyRange) is deprecated"

api/v1beta1/machinedeployment_types.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ const (
4242
RevisionAnnotation = "machinedeployment.clusters.x-k8s.io/revision"
4343

4444
// RevisionHistoryAnnotation maintains the history of all old revisions that a machine set has served for a machine deployment.
45+
//
46+
// Deprecated: This annotation is deprecated and is going to be removed in the next apiVersion. Please see https://github.com/kubernetes-sigs/cluster-api/issues/10479 for more details.
4547
RevisionHistoryAnnotation = "machinedeployment.clusters.x-k8s.io/revision-history"
4648

4749
// DesiredReplicasAnnotation is the desired replicas for a machine deployment recorded as an annotation
@@ -129,6 +131,9 @@ type MachineDeploymentSpec struct {
129131
// The number of old MachineSets to retain to allow rollback.
130132
// This is a pointer to distinguish between explicit zero and not specified.
131133
// Defaults to 1.
134+
//
135+
// 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/10479 for more details.
136+
//
132137
// +optional
133138
RevisionHistoryLimit *int32 `json:"revisionHistoryLimit,omitempty"`
134139

api/v1beta1/zz_generated.openapi.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/clusterctl/client/client.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ type AlphaClient interface {
8585
// RolloutResume provides rollout resume of paused cluster-api resources
8686
RolloutResume(ctx context.Context, options RolloutResumeOptions) error
8787
// RolloutUndo provides rollout rollback of cluster-api resources
88+
//
89+
// Deprecated: RolloutUndo is deprecated and will be removed in one of the upcoming releases.
8890
RolloutUndo(ctx context.Context, options RolloutUndoOptions) error
8991
// TopologyPlan dry runs the topology reconciler
9092
//

cmd/clusterctl/cmd/rollout/undo.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ func NewCmdRolloutUndo(cfgFile string) *cobra.Command {
6767
cmd.Flags().StringVarP(&undoOpt.namespace, "namespace", "n", "", "Namespace where the resource(s) reside. If unspecified, the defult namespace will be used.")
6868
cmd.Flags().Int64Var(&undoOpt.toRevision, "to-revision", undoOpt.toRevision, "The revision to rollback to. Default to 0 (last revision).")
6969

70+
cmd.Deprecated = "it will be removed in one of the upcoming releases.\n"
71+
7072
return cmd
7173
}
7274

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

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

0 commit comments

Comments
 (0)