Skip to content

Commit d03e13f

Browse files
committed
enable SSA tag linter
1 parent 5fdb821 commit d03e13f

16 files changed

+115
-1
lines changed

.golangci-kal.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ linters:
1818
linters:
1919
# TODO: remove linters from this list as we add support from them
2020
disable:
21-
- "ssatags"
21+
# integers linter will force type change from int to int32/int64, we are going to wait for v1beta1 to enable this
2222
- "integers"
23+
# jsontags linter will force the json fields to go from _ usage to camelCase, we will wait for v1beta1 to enable this
2324
- "jsontags"
2425
- "requiredfields"
2526
- "optionalfields"

api/v1alpha2/firewallrule_types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ type FirewallRuleSpec struct {
5252
// addressSetRefs is a list of references to AddressSets as an alternative to
5353
// using Addresses but can be used in conjunction with it.
5454
// +optional
55+
// +listType=atomic
5556
AddressSetRefs []*corev1.ObjectReference `json:"addressSetRefs,omitempty"`
5657
}
5758

api/v1alpha2/linodecluster_types.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,8 @@ type NetworkSpec struct {
213213

214214
// additionalPorts contains list of ports to be configured with NodeBalancer.
215215
// +optional
216+
// +listType=map
217+
// +listMapKey=port
216218
AdditionalPorts []LinodeNBPortConfig `json:"additionalPorts,omitempty"`
217219

218220
// subnetName is the name/label of the VPC subnet to be used by the cluster

api/v1alpha2/linodefirewall_types.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,13 @@ type LinodeFirewallSpec struct {
4040

4141
// inboundRules is a list of FirewallRules that will be applied to the Firewall.
4242
// +optional
43+
// +listType=atomic
4344
InboundRules []FirewallRuleSpec `json:"inboundRules,omitempty"`
4445

4546
// inboundRuleRefs is a list of references to FirewallRules as an alternative to
4647
// using InboundRules but can be used in conjunction with it
4748
// +optional
49+
// +listType=atomic
4850
InboundRuleRefs []*corev1.ObjectReference `json:"inboundRuleRefs,omitempty"`
4951

5052
// inboundPolicy determines if traffic by default should be ACCEPTed or DROPped. Defaults to ACCEPT if not defined.
@@ -55,11 +57,13 @@ type LinodeFirewallSpec struct {
5557

5658
// outboundRules is a list of FirewallRules that will be applied to the Firewall.
5759
// +optional
60+
// +listType=atomic
5861
OutboundRules []FirewallRuleSpec `json:"outboundRules,omitempty"`
5962

6063
// outboundRuleRefs is a list of references to FirewallRules as an alternative to
6164
// using OutboundRules but can be used in conjunction with it
6265
// +optional
66+
// +listType=atomic
6367
OutboundRuleRefs []*corev1.ObjectReference `json:"outboundRuleRefs,omitempty"`
6468

6569
// outboundPolicy determines if traffic by default should be ACCEPTed or DROPped. Defaults to ACCEPT if not defined.

api/v1alpha2/linodemachine_types.go

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,13 @@ type LinodeMachineSpec struct {
6464
// authorizedKeys is a list of SSH public keys to add to the instance.
6565
// +optional
6666
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Value is immutable"
67+
// +listType=set
6768
AuthorizedKeys []string `json:"authorizedKeys,omitempty"`
6869

6970
// authorizedUsers is a list of usernames to add to the instance.
7071
// +optional
7172
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Value is immutable"
73+
// +listType=set
7274
AuthorizedUsers []string `json:"authorizedUsers,omitempty"`
7375

7476
// backupID is the ID of the backup to restore the instance from.
@@ -84,12 +86,14 @@ type LinodeMachineSpec struct {
8486
// interfaces is a list of legacy network interfaces to use for the instance.
8587
// +optional
8688
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Value is immutable"
89+
// +listType=atomic
8790
Interfaces []InstanceConfigInterfaceCreateOptions `json:"interfaces,omitempty"`
8891

8992
// linodeInterfaces is a list of Linode network interfaces to use for the instance. Requires Linode Interfaces beta opt-in to use.
9093
// +optional
9194
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Value is immutable"
9295
// +kubebuilder:object:generate=true
96+
// +listType=atomic
9397
LinodeInterfaces []LinodeInterfaceCreateOptions `json:"linodeInterfaces,omitempty"`
9498

9599
// backupsEnabled is a boolean indicating whether backups should be enabled for the instance.
@@ -104,6 +108,7 @@ type LinodeMachineSpec struct {
104108

105109
// tags is a list of tags to apply to the Linode instance.
106110
// +optional
111+
// +listType=set
107112
Tags []string `json:"tags,omitempty"`
108113

109114
// firewallID is the id of the cloud firewall to apply to the Linode Instance
@@ -298,6 +303,7 @@ type InstanceConfigInterfaceCreateOptions struct {
298303

299304
// ipRanges is a list of IPv4 ranges to assign to the interface.
300305
// +optional
306+
// +listType=set
301307
IPRanges []string `json:"ipRanges,omitempty"`
302308
}
303309

@@ -350,6 +356,8 @@ type PublicInterfaceCreateOptions struct {
350356
type PublicInterfaceIPv4CreateOptions struct {
351357
// addresses is the IPv4 addresses for the public interface.
352358
// +optional
359+
// +listType=map
360+
// +listMapKey=address
353361
Addresses []PublicInterfaceIPv4AddressCreateOptions `json:"addresses,omitempty"`
354362
}
355363

@@ -368,6 +376,8 @@ type PublicInterfaceIPv4AddressCreateOptions struct {
368376
type PublicInterfaceIPv6CreateOptions struct {
369377
// ranges is the IPv6 ranges for the public interface.
370378
// +optional
379+
// +listType=map
380+
// +listMapKey=range
371381
Ranges []PublicInterfaceIPv6RangeCreateOptions `json:"ranges,omitempty"`
372382
}
373383

@@ -397,10 +407,14 @@ type VPCInterfaceCreateOptions struct {
397407
type VPCInterfaceIPv6CreateOptions struct {
398408
// slaac is the IPv6 SLAAC configuration for the interface.
399409
// +optional
410+
// +listType=map
411+
// +listMapKey=range
400412
SLAAC []VPCInterfaceIPv6SLAACCreateOptions `json:"slaac,omitempty"`
401413

402414
// ranges is the IPv6 ranges for the interface.
403415
// +optional
416+
// +listType=map
417+
// +listMapKey=range
404418
Ranges []VPCInterfaceIPv6RangeCreateOptions `json:"ranges,omitempty"`
405419

406420
// is_public is a boolean indicating whether the interface is public.
@@ -426,10 +440,14 @@ type VPCInterfaceIPv6RangeCreateOptions struct {
426440
type VPCInterfaceIPv4CreateOptions struct {
427441
// addresses is the IPv4 addresses for the interface.
428442
// +optional
443+
// +listType=map
444+
// +listMapKey=address
429445
Addresses []VPCInterfaceIPv4AddressCreateOptions `json:"addresses,omitempty"`
430446

431447
// ranges is the IPv4 ranges for the interface.
432448
// +optional
449+
// +listType=map
450+
// +listMapKey=range
433451
Ranges []VPCInterfaceIPv4RangeCreateOptions `json:"ranges,omitempty"`
434452
}
435453

@@ -494,6 +512,8 @@ type LinodeMachineStatus struct {
494512

495513
// addresses contains the Linode instance associated addresses.
496514
// +optional
515+
// +listType=map
516+
// +listMapKey=address
497517
Addresses []clusterv1.MachineAddress `json:"addresses,omitempty"`
498518

499519
// cloudinitMetadataSupport determines whether to use cloud-init or not.
@@ -547,6 +567,7 @@ type LinodeMachineStatus struct {
547567

548568
// tags are the tags applied to the Linode Machine.
549569
// +optional
570+
// +listType=set
550571
Tags []string `json:"tags,omitempty"`
551572
}
552573

api/v1alpha2/linodemachinetemplate_types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ type LinodeMachineTemplateStatus struct {
4040

4141
// tags that are currently applied to the LinodeMachineTemplate.
4242
// +optional
43+
// +listType=set
4344
Tags []string `json:"tags,omitempty"`
4445

4546
// firewallID that is currently applied to the LinodeMachineTemplate.

api/v1alpha2/linodeobjectstoragekey_types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ type LinodeObjectStorageKeySpec struct {
6868
// bucketAccess is the list of object storage bucket labels which can be accessed using the key
6969
// +kubebuilder:validation:MinItems=1
7070
// +required
71+
// +listType=atomic
7172
BucketAccess []BucketAccessRef `json:"bucketAccess"`
7273

7374
// credentialsRef is a reference to a Secret that contains the credentials to use for generating access keys.

api/v1alpha2/linodevpc_types.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,20 @@ type LinodeVPCSpec struct {
4747
// Once ranges are allocated based on the IPv6Range field, they will be
4848
// added to this field.
4949
// +optional
50+
// +listType=map
51+
// +listMapKey=range
5052
IPv6 []linodego.VPCIPv6Range `json:"ipv6,omitempty"`
5153

5254
// ipv6Range is a list of IPv6 ranges to allocate to the VPC.
5355
// If not specified, the VPC will not have an IPv6 range allocated.
5456
// Once ranges are allocated, they will be added to the IPv6 field.
5557
// +optional
58+
// +listType=atomic
5659
IPv6Range []VPCCreateOptionsIPv6 `json:"ipv6Range,omitempty"`
5760

5861
// subnets is a list of subnets to create in the VPC.
5962
// +optional
63+
// +listType=atomic
6064
Subnets []VPCSubnetCreateOptions `json:"subnets,omitempty"`
6165

6266
// retain allows you to keep the VPC after the LinodeVPC object is deleted.
@@ -103,12 +107,15 @@ type VPCSubnetCreateOptions struct {
103107
// Once ranges are allocated based on the IPv6Range field, they will be
104108
// added to this field.
105109
// +optional
110+
// +listType=map
111+
// +listMapKey=range
106112
IPv6 []linodego.VPCIPv6Range `json:"ipv6,omitempty"`
107113

108114
// ipv6Range is a list of IPv6 ranges to allocate to the subnet.
109115
// If not specified, the subnet will not have an IPv6 range allocated.
110116
// Once ranges are allocated, they will be added to the IPv6 field.
111117
// +optional
118+
// +listType=atomic
112119
IPv6Range []VPCSubnetCreateOptionsIPv6 `json:"ipv6Range,omitempty"`
113120

114121
// subnetID is subnet id for the subnet

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ spec:
9797
type: object
9898
x-kubernetes-map-type: atomic
9999
type: array
100+
x-kubernetes-list-type: atomic
100101
addresses:
101102
description: addresses is a list of addresses to apply the rule to.
102103
properties:

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@ spec:
111111
- port
112112
type: object
113113
type: array
114+
x-kubernetes-list-map-keys:
115+
- port
116+
x-kubernetes-list-type: map
114117
apiserverLoadBalancerPort:
115118
description: |-
116119
apiserverLoadBalancerPort used by the api server. It must be valid ports range (1-65535).

0 commit comments

Comments
 (0)