Skip to content

Commit 7fc7609

Browse files
committed
fix deprecated warnings and restrict KAL linter exclusions to v1alpha2 APIs
1 parent ac1346f commit 7fc7609

File tree

7 files changed

+42
-34
lines changed

7 files changed

+42
-34
lines changed

.golangci-kal.yml

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,26 @@ linters:
1515
type: "module"
1616
description: Kube API LInter lints Kube like APIs based on API conventions and best practices.
1717
settings:
18-
linters:
19-
# TODO: remove linters from this list as we add support from them
20-
disable:
21-
# integers linter will force type change from int to int32/int64, we are going to wait for v1beta1 to enable this
22-
- "integers"
23-
# optionalfields requires changing fields to pointers in a way that might be hard to support in a backwards compatible way
24-
- "optionalfields"
25-
lintersConfig: { }
18+
linters: {}
19+
lintersConfig:
20+
optionalfields:
21+
pointers:
22+
preference: WhenRequired
2623
exclusions:
2724
rules:
2825
- path-except: "^api/"
2926
linters:
3027
- kubeapilinter
28+
# integers linter will force type change from int to int32/int64, we are going to wait for v1beta1 to enable this
29+
- path: "api/v1alpha2/*"
30+
text: "integers"
31+
linters:
32+
- kubeapilinter
33+
# optionalfields requires changing fields to pointers in a way that might be hard to support in a backwards compatible way
34+
- path: "api/v1alpha2/*"
35+
text: "optionalfields"
36+
linters:
37+
- kubeapilinter
3138
issues:
3239
max-issues-per-linter: 0
3340
max-same-issues: 0

api/v1alpha2/linodemachine_types.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,9 @@ type LinodeMachineStatus struct {
528528
Addresses []clusterv1.MachineAddress `json:"addresses,omitempty"`
529529

530530
// cloudinitMetadataSupport determines whether to use cloud-init or not.
531-
// Deprecated: Stackscript no longer in use, so this field is not used.
531+
//
532+
// Deprecated: stackscript are no longer in use, so this field is not used.
533+
//
532534
// +kubebuilder:deprecatedversion:warning="CloudinitMetadataSupport is deprecated"
533535
// +optional
534536
// +kubebuilder:default=true

api/v1alpha2/linodeobjectstoragekey_types.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,18 @@ type LinodeObjectStorageKeySpec struct {
9191
GeneratedSecret `json:"generatedSecret"`
9292

9393
// secretType instructs the controller what type of secret to generate containing access key details.
94-
// Deprecated: Use generatedSecret.type.
94+
//
95+
// Deprecated: secretType is no longer supported, Use generatedSecret.type.
96+
//
9597
// +kubebuilder:validation:Enum=Opaque;addons.cluster.x-k8s.io/resource-set
9698
// +kubebuilder:deprecatedversion:warning="secretType deprecated by generatedSecret.type"
9799
// +optional
98100
SecretType corev1.SecretType `json:"secretType,omitempty"`
99101

100102
// secretDataFormat instructs the controller how to format the data stored in the secret containing access key details.
101-
// Deprecated: Use generatedSecret.format.
103+
//
104+
// Deprecated: secretDataFormat is no longer supported, please use generatedSecret.format.
105+
//
102106
// +kubebuilder:deprecatedversion:warning="secretDataFormat deprecated by generatedSecret.format"
103107
// +optional
104108
SecretDataFormat map[string]string `json:"secretDataFormat,omitempty"`

config/crd/bases/infrastructure.cluster.x-k8s.io_linodemachines.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -941,7 +941,8 @@ spec:
941941
default: true
942942
description: |-
943943
cloudinitMetadataSupport determines whether to use cloud-init or not.
944-
Deprecated: Stackscript no longer in use, so this field is not used.
944+
945+
Deprecated: stackscript are no longer in use, so this field is not used.
945946
type: boolean
946947
conditions:
947948
description: conditions define the current service state of the LinodeMachine.

config/crd/bases/infrastructure.cluster.x-k8s.io_linodeobjectstoragekeys.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,12 +145,14 @@ spec:
145145
type: string
146146
description: |-
147147
secretDataFormat instructs the controller how to format the data stored in the secret containing access key details.
148-
Deprecated: Use generatedSecret.format.
148+
149+
Deprecated: secretDataFormat is no longer supported, please use generatedSecret.format.
149150
type: object
150151
secretType:
151152
description: |-
152153
secretType instructs the controller what type of secret to generate containing access key details.
153-
Deprecated: Use generatedSecret.type.
154+
155+
Deprecated: secretType is no longer supported, Use generatedSecret.type.
154156
enum:
155157
- Opaque
156158
- addons.cluster.x-k8s.io/resource-set

0 commit comments

Comments
 (0)