Skip to content

Commit 31e4807

Browse files
Update Deprecated comments to correctly trigger staticcheck linter
Signed-off-by: killianmuldoon <[email protected]>
1 parent 5774dcc commit 31e4807

24 files changed

+69
-28
lines changed

.golangci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,10 @@ issues:
179179
# changes in PRs and avoid nitpicking.
180180
exclude-use-default: false
181181
exclude-rules:
182+
# Specific exclude rules for deprecated fields that are still part of the codebase. These should be removed as the referenced deprecated item is removed from the project.
183+
- linters:
184+
- staticcheck
185+
text: "SA1019: (bootstrapv1.ClusterStatus|clusterv1.ClusterTopologyManagedFieldsAnnotation|scope.Config.Spec.UseExperimentalRetryJoin|DockerMachine.Spec.Bootstrapped|machineStatus.Bootstrapped) is deprecated"
182186
- linters:
183187
- revive
184188
text: "exported: exported method .*\\.(Reconcile|SetupWithManager|SetupWebhookWithManager) should have comment or be unexported"

api/v1alpha4/common_types.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ const (
2727
ClusterLabelName = "cluster.x-k8s.io/cluster-name"
2828

2929
// ClusterTopologyLabelName is the label set on all the object which are managed as part of a ClusterTopology.
30+
//
3031
// Deprecated: use ClusterTopologyOwnedLabel instead.
3132
ClusterTopologyLabelName = "cluster.x-k8s.io/topology"
3233

@@ -117,11 +118,13 @@ var (
117118

118119
const (
119120
// MachineNodeNameIndex is used by the Machine Controller to index Machines by Node name, and add a watch on Nodes.
121+
//
120122
// Deprecated: Use api/v1alpha4/index.MachineNodeNameField instead.
121123
MachineNodeNameIndex = "status.nodeRef.name"
122124

123125
// MachineProviderIDIndex is used to index Machines by ProviderID. It's useful to find Machines
124126
// in a management cluster from Nodes in a workload cluster.
127+
//
125128
// Deprecated: Use api/v1alpha4/index.MachineProviderIDField instead.
126129
MachineProviderIDIndex = "spec.providerID"
127130
)

api/v1beta1/common_types.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ const (
4040
// to easily discover which fields have been set by templates + patches/variables at a given reconcile;
4141
// instead, it is not necessary to store managed paths for typed objets (e.g. Cluster, MachineDeployments)
4242
// given that the topology controller explicitly sets a well-known, immutable list of fields at every reconcile.
43+
//
4344
// Deprecated: Topology controller is now using server side apply and this annotation will be removed in a future release.
45+
// When removing also remove from staticcheck exclude-rules for SA1019 in golangci.yml.
4446
ClusterTopologyManagedFieldsAnnotation = "topology.cluster.x-k8s.io/managed-field-paths"
4547

4648
// ClusterTopologyMachineDeploymentLabelName is the label set on the generated MachineDeployment objects

api/v1beta1/condition_consts.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ const (
138138

139139
// MachineHealthCheckSuccededCondition is set on machines that have passed a healthcheck by the MachineHealthCheck controller.
140140
// In the event that the health check fails it will be set to False.
141+
//
141142
// Deprecated: This const is going to be removed in a next release. Use MachineHealthCheckSucceededCondition instead.
142143
MachineHealthCheckSuccededCondition ConditionType = "HealthCheckSucceeded"
143144

bootstrap/kubeadm/api/v1alpha4/kubeadm_types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ type ImageMeta struct {
180180

181181
// ClusterStatus contains the cluster status. The ClusterStatus will be stored in the kubeadm-config
182182
// ConfigMap in the cluster, and then updated by kubeadm when additional control plane instance joins or leaves the cluster.
183+
//
183184
// Deprecated: ClusterStatus has been removed from kubeadm v1beta3 API; This type is preserved only to support
184185
// conversion to older versions of the kubeadm API.
185186
type ClusterStatus struct {

bootstrap/kubeadm/api/v1beta1/kubeadm_types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ type ImageMeta struct {
192192

193193
// ClusterStatus contains the cluster status. The ClusterStatus will be stored in the kubeadm-config
194194
// ConfigMap in the cluster, and then updated by kubeadm when additional control plane instance joins or leaves the cluster.
195+
//
195196
// Deprecated: ClusterStatus has been removed from kubeadm v1beta3 API; This type is preserved only to support
196197
// conversion to older versions of the kubeadm API.
197198
type ClusterStatus struct {

bootstrap/kubeadm/api/v1beta1/kubeadmconfig_types.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,9 @@ type KubeadmConfigSpec struct {
9797
//
9898
// For more information, refer to https://github.com/kubernetes-sigs/cluster-api/pull/2763#discussion_r397306055.
9999
// +optional
100+
//
100101
// Deprecated: This experimental fix is no longer needed and this field will be removed in a future release.
102+
// When removing also remove from staticcheck exclude-rules for SA1019 in golangci.yml
101103
UseExperimentalRetryJoin bool `json:"useExperimentalRetryJoin,omitempty"`
102104

103105
// Ignition contains Ignition specific configuration.

bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigs.yaml

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

bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigtemplates.yaml

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

cmd/clusterctl/api/v1alpha3/provider_type.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ type Provider struct {
4949

5050
// WatchedNamespace indicates the namespace where the provider controller is watching.
5151
// If empty the provider controller is watching for objects in all namespaces.
52+
//
5253
// Deprecated: in clusterctl v1alpha4 all the providers watch all the namespaces; this field will be removed in a future version of this API
5354
// +optional
5455
WatchedNamespace string `json:"watchedNamespace,omitempty"`

0 commit comments

Comments
 (0)