Skip to content

Commit

Permalink
Deprecate MachineDeployment revision management
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Büringer [email protected]
  • Loading branch information
sbueringer committed Jul 10, 2024
1 parent 7a53f93 commit b1739f4
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,10 @@ issues:
- linters:
- staticcheck
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"
# Deprecations for MD revision management
- linters:
- staticcheck
text: "SA1019: (deployment|m|md)(.Spec.RevisionHistoryLimit)|clusterv1.RevisionHistoryAnnotation|c.RolloutUndo is deprecated"
# Specific exclude rules for deprecated packages that are still part of the codebase. These
# should be removed as the referenced deprecated packages are removed from the project.
- linters:
Expand Down
5 changes: 5 additions & 0 deletions api/v1beta1/machinedeployment_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ const (
RevisionAnnotation = "machinedeployment.clusters.x-k8s.io/revision"

// RevisionHistoryAnnotation maintains the history of all old revisions that a machine set has served for a machine deployment.
//
// 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.
RevisionHistoryAnnotation = "machinedeployment.clusters.x-k8s.io/revision-history"

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

Expand Down
2 changes: 1 addition & 1 deletion api/v1beta1/zz_generated.openapi.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions cmd/clusterctl/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ type AlphaClient interface {
// RolloutResume provides rollout resume of paused cluster-api resources
RolloutResume(ctx context.Context, options RolloutResumeOptions) error
// RolloutUndo provides rollout rollback of cluster-api resources
//
// Deprecated: RolloutUndo is deprecated and will be removed in one of the upcoming releases.
RolloutUndo(ctx context.Context, options RolloutUndoOptions) error
// TopologyPlan dry runs the topology reconciler
//
Expand Down
2 changes: 2 additions & 0 deletions cmd/clusterctl/cmd/rollout/undo.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ func NewCmdRolloutUndo(cfgFile string) *cobra.Command {
cmd.Flags().StringVarP(&undoOpt.namespace, "namespace", "n", "", "Namespace where the resource(s) reside. If unspecified, the defult namespace will be used.")
cmd.Flags().Int64Var(&undoOpt.toRevision, "to-revision", undoOpt.toRevision, "The revision to rollback to. Default to 0 (last revision).")

cmd.Deprecated = "it will be removed in one of the upcoming releases.\n"

return cmd
}

Expand Down
3 changes: 3 additions & 0 deletions config/crd/bases/cluster.x-k8s.io_machinedeployments.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b1739f4

Please sign in to comment.