Skip to content

Commit 70f0105

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

File tree

12 files changed

+33
-193
lines changed

12 files changed

+33
-193
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

docs/src/reference/out.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,7 @@ _Appears in:_
723723
| `conditions` _[Condition](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#condition-v1-meta) array_ | conditions define the current service state of the LinodeMachine. | | |
724724
| `ready` _boolean_ | ready is true when the provider resource is ready. | false | |
725725
| `addresses` _MachineAddress array_ | addresses contains the Linode instance associated addresses. | | |
726-
| `cloudinitMetadataSupport` _boolean_ | cloudinitMetadataSupport determines whether to use cloud-init or not.<br />Deprecated: Stackscript no longer in use, so this field is not used. | true | |
726+
| `cloudinitMetadataSupport` _boolean_ | cloudinitMetadataSupport determines whether to use cloud-init or not.<br />Deprecated: stackscript are no longer in use, so this field is not used. | true | |
727727
| `instanceState` _[InstanceStatus](#instancestatus)_ | instanceState is the state of the Linode instance for this machine. | | |
728728
| `failureReason` _string_ | failureReason will be set in the event that there is a terminal problem<br />reconciling the Machine and will contain a succinct value suitable<br />for machine interpretation.<br />This field should not be set for transitive errors that a controller<br />faces that are expected to be fixed automatically over<br />time (like service outages), but instead indicate that something is<br />fundamentally wrong with the Machine's spec or the configuration of<br />the controller, and that manual intervention is required. Examples<br />of terminal errors would be invalid combinations of settings in the<br />spec, values that are unsupported by the controller, or the<br />responsible controller itself being critically misconfigured.<br />Any transient errors that occur during the reconciliation of Machines<br />can be added as events to the Machine object and/or logged in the<br />controller's output. | | |
729729
| `failureMessage` _string_ | failureMessage will be set in the event that there is a terminal problem<br />reconciling the Machine and will contain a more verbose string suitable<br />for logging and human consumption.<br />This field should not be set for transitive errors that a controller<br />faces that are expected to be fixed automatically over<br />time (like service outages), but instead indicate that something is<br />fundamentally wrong with the Machine's spec or the configuration of<br />the controller, and that manual intervention is required. Examples<br />of terminal errors would be invalid combinations of settings in the<br />spec, values that are unsupported by the controller, or the<br />responsible controller itself being critically misconfigured.<br />Any transient errors that occur during the reconciliation of Machines<br />can be added as events to the Machine object and/or logged in the<br />controller's output. | | |
@@ -982,8 +982,8 @@ _Appears in:_
982982
| `credentialsRef` _[SecretReference](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#secretreference-v1-core)_ | credentialsRef is a reference to a Secret that contains the credentials to use for generating access keys.<br />If not supplied, then the credentials of the controller will be used. | | |
983983
| `keyGeneration` _integer_ | keyGeneration may be modified to trigger a rotation of the access key. | 0 | |
984984
| `generatedSecret` _[GeneratedSecret](#generatedsecret)_ | generatedSecret configures the Secret to generate containing access key details. | | |
985-
| `secretType` _[SecretType](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#secrettype-v1-core)_ | secretType instructs the controller what type of secret to generate containing access key details.<br />Deprecated: Use generatedSecret.type. | | Enum: [Opaque addons.cluster.x-k8s.io/resource-set] <br /> |
986-
| `secretDataFormat` _object (keys:string, values:string)_ | secretDataFormat instructs the controller how to format the data stored in the secret containing access key details.<br />Deprecated: Use generatedSecret.format. | | |
985+
| `secretType` _[SecretType](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#secrettype-v1-core)_ | secretType instructs the controller what type of secret to generate containing access key details.<br />Deprecated: secretType is no longer supported, Use generatedSecret.type. | | Enum: [Opaque addons.cluster.x-k8s.io/resource-set] <br /> |
986+
| `secretDataFormat` _object (keys:string, values:string)_ | secretDataFormat instructs the controller how to format the data stored in the secret containing access key details.<br />Deprecated: secretDataFormat is no longer supported, please use generatedSecret.format. | | |
987987

988988

989989
#### LinodeObjectStorageKeyStatus

e2e/linodeobjectstoragekey-controller/deprecated-secret/assert-capi-resources.yaml

Lines changed: 0 additions & 15 deletions
This file was deleted.

e2e/linodeobjectstoragekey-controller/deprecated-secret/assert-key-and-secret.yaml

Lines changed: 0 additions & 19 deletions
This file was deleted.

e2e/linodeobjectstoragekey-controller/deprecated-secret/chainsaw-test.yaml

Lines changed: 0 additions & 108 deletions
This file was deleted.

e2e/linodeobjectstoragekey-controller/deprecated-secret/check-key-and-secret-deletion.yaml

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)