Skip to content

Commit 7cbb3b4

Browse files
committed
Mark all []string array fields as atomic
1 parent 236988f commit 7cbb3b4

File tree

6 files changed

+31
-0
lines changed

6 files changed

+31
-0
lines changed

api/bootstrap/kubeadm/v1beta2/kubeadm_types.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ type InitConfiguration struct {
9999
// The list of phases can be obtained with the "kubeadm init --help" command.
100100
// This option takes effect only on Kubernetes >=1.22.0.
101101
// +optional
102+
// +listType=atomic
102103
// +kubebuilder:validation:MaxItems=50
103104
// +kubebuilder:validation:items:MinLength=1
104105
// +kubebuilder:validation:items:MaxLength=256
@@ -211,6 +212,7 @@ type APIServer struct {
211212

212213
// certSANs sets extra Subject Alternative Names for the API Server signing cert.
213214
// +optional
215+
// +listType=atomic
214216
// +kubebuilder:validation:MaxItems=100
215217
// +kubebuilder:validation:items:MinLength=1
216218
// +kubebuilder:validation:items:MaxLength=253
@@ -357,6 +359,7 @@ type NodeRegistrationOptions struct {
357359
// ignorePreflightErrors provides a slice of pre-flight errors to be ignored when the current node is registered, e.g. 'IsPrivilegedUser,Swap'.
358360
// Value 'all' ignores errors from all checks.
359361
// +optional
362+
// +listType=atomic
360363
// +kubebuilder:validation:MaxItems=50
361364
// +kubebuilder:validation:items:MinLength=1
362365
// +kubebuilder:validation:items:MaxLength=512
@@ -383,31 +386,38 @@ type BootstrapToken struct {
383386
// Used for joining nodes in the cluster.
384387
// +required
385388
Token *BootstrapTokenString `json:"token"`
389+
386390
// description sets a human-friendly message why this token exists and what it's used
387391
// for, so other administrators can know its purpose.
388392
// +optional
389393
// +kubebuilder:validation:MinLength=1
390394
// +kubebuilder:validation:MaxLength=512
391395
Description string `json:"description,omitempty"`
396+
392397
// ttlSeconds defines the time to live for this token. Defaults to 24h.
393398
// Expires and ttlSeconds are mutually exclusive.
394399
// +optional
395400
// +kubebuilder:validation:Minimum=0
396401
TTLSeconds *int32 `json:"ttlSeconds,omitempty"`
402+
397403
// expires specifies the timestamp when this token expires. Defaults to being set
398404
// dynamically at runtime based on the ttlSeconds. Expires and ttlSeconds are mutually exclusive.
399405
// +optional
400406
Expires *metav1.Time `json:"expires,omitempty"`
407+
401408
// usages describes the ways in which this token can be used. Can by default be used
402409
// for establishing bidirectional trust, but that can be changed here.
403410
// +optional
411+
// +listType=atomic
404412
// +kubebuilder:validation:MaxItems=100
405413
// +kubebuilder:validation:items:MinLength=1
406414
// +kubebuilder:validation:items:MaxLength=256
407415
Usages []string `json:"usages,omitempty"`
416+
408417
// groups specifies the extra groups that this token will authenticate as when/if
409418
// used for authentication
410419
// +optional
420+
// +listType=atomic
411421
// +kubebuilder:validation:MaxItems=100
412422
// +kubebuilder:validation:items:MinLength=1
413423
// +kubebuilder:validation:items:MaxLength=256
@@ -461,13 +471,15 @@ type LocalEtcd struct {
461471

462472
// serverCertSANs sets extra Subject Alternative Names for the etcd server signing cert.
463473
// +optional
474+
// +listType=atomic
464475
// +kubebuilder:validation:MaxItems=100
465476
// +kubebuilder:validation:items:MinLength=1
466477
// +kubebuilder:validation:items:MaxLength=253
467478
ServerCertSANs []string `json:"serverCertSANs,omitempty"`
468479

469480
// peerCertSANs sets extra Subject Alternative Names for the etcd peer signing cert.
470481
// +optional
482+
// +listType=atomic
471483
// +kubebuilder:validation:MaxItems=100
472484
// +kubebuilder:validation:items:MinLength=1
473485
// +kubebuilder:validation:items:MaxLength=253
@@ -479,6 +491,7 @@ type LocalEtcd struct {
479491
type ExternalEtcd struct {
480492
// endpoints of etcd members. Required for ExternalEtcd.
481493
// +required
494+
// +listType=atomic
482495
// +kubebuilder:validation:MinItems=1
483496
// +kubebuilder:validation:MaxItems=50
484497
// +kubebuilder:validation:items:MinLength=1
@@ -538,6 +551,7 @@ type JoinConfiguration struct {
538551
// The list of phases can be obtained with the "kubeadm init --help" command.
539552
// This option takes effect only on Kubernetes >=1.22.0.
540553
// +optional
554+
// +listType=atomic
541555
// +kubebuilder:validation:MaxItems=50
542556
// +kubebuilder:validation:items:MinLength=1
543557
// +kubebuilder:validation:items:MaxLength=256
@@ -606,6 +620,7 @@ type BootstrapTokenDiscovery struct {
606620
// ASN.1. These hashes can be calculated using, for example, OpenSSL:
607621
// openssl x509 -pubkey -in ca.crt openssl rsa -pubin -outform der 2>&/dev/null | openssl dgst -sha256 -hex
608622
// +optional
623+
// +listType=atomic
609624
// +kubebuilder:validation:MaxItems=100
610625
// +kubebuilder:validation:items:MinLength=1
611626
// +kubebuilder:validation:items:MaxLength=512
@@ -743,6 +758,7 @@ type KubeConfigAuthExec struct {
743758

744759
// args is the arguments to pass to the command when executing it.
745760
// +optional
761+
// +listType=atomic
746762
// +kubebuilder:validation:MaxItems=100
747763
// +kubebuilder:validation:items:MinLength=1
748764
// +kubebuilder:validation:items:MaxLength=512

api/bootstrap/kubeadm/v1beta2/kubeadmconfig_types.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ type KubeadmConfigSpec struct {
8282
// module. bootcmd will run on every boot, 'cloud-init-per' command can be used to make bootcmd run exactly
8383
// once. This is typically run in the cloud-init.service systemd unit. This has no effect in Ignition.
8484
// +optional
85+
// +listType=atomic
8586
// +kubebuilder:validation:MaxItems=1000
8687
// +kubebuilder:validation:items:MinLength=1
8788
// +kubebuilder:validation:items:MaxLength=10240
@@ -91,6 +92,7 @@ type KubeadmConfigSpec struct {
9192
// With cloud-init, this is prepended to the runcmd module configuration, and is typically executed in
9293
// the cloud-final.service systemd unit. In Ignition, this is prepended to /etc/kubeadm.sh.
9394
// +optional
95+
// +listType=atomic
9496
// +kubebuilder:validation:MaxItems=1000
9597
// +kubebuilder:validation:items:MinLength=1
9698
// +kubebuilder:validation:items:MaxLength=10240
@@ -100,6 +102,7 @@ type KubeadmConfigSpec struct {
100102
// With cloud-init, this is appended to the runcmd module configuration, and is typically executed in
101103
// the cloud-final.service systemd unit. In Ignition, this is appended to /etc/kubeadm.sh.
102104
// +optional
105+
// +listType=atomic
103106
// +kubebuilder:validation:MaxItems=1000
104107
// +kubebuilder:validation:items:MinLength=1
105108
// +kubebuilder:validation:items:MaxLength=10240
@@ -766,6 +769,7 @@ type User struct {
766769

767770
// sshAuthorizedKeys specifies a list of ssh authorized keys for the user
768771
// +optional
772+
// +listType=atomic
769773
// +kubebuilder:validation:MaxItems=100
770774
// +kubebuilder:validation:items:MinLength=1
771775
// +kubebuilder:validation:items:MaxLength=2048
@@ -776,6 +780,7 @@ type User struct {
776780
type NTP struct {
777781
// servers specifies which NTP servers to use
778782
// +optional
783+
// +listType=atomic
779784
// +kubebuilder:validation:MaxItems=100
780785
// +kubebuilder:validation:items:MinLength=1
781786
// +kubebuilder:validation:items:MaxLength=512
@@ -863,6 +868,7 @@ type Filesystem struct {
863868

864869
// extraOpts defined extra options to add to the command for creating the file system.
865870
// +optional
871+
// +listType=atomic
866872
// +kubebuilder:validation:MaxItems=100
867873
// +kubebuilder:validation:items:MinLength=1
868874
// +kubebuilder:validation:items:MaxLength=256

api/core/v1beta2/cluster_types.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -812,6 +812,7 @@ type MachinePoolTopology struct {
812812
// failureDomains is the list of failure domains the machine pool will be created in.
813813
// Must match a key in the FailureDomains map stored on the cluster object.
814814
// +optional
815+
// +listType=atomic
815816
// +kubebuilder:validation:MaxItems=100
816817
// +kubebuilder:validation:items:MinLength=1
817818
// +kubebuilder:validation:items:MaxLength=256
@@ -941,6 +942,7 @@ type ClusterNetwork struct {
941942
type NetworkRanges struct {
942943
// cidrBlocks is a list of CIDR blocks.
943944
// +required
945+
// +listType=atomic
944946
// +kubebuilder:validation:MaxItems=100
945947
// +kubebuilder:validation:items:MinLength=1
946948
// +kubebuilder:validation:items:MaxLength=43

api/core/v1beta2/clusterclass_types.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,7 @@ type MachinePoolClass struct {
459459
// Must match a key in the FailureDomains map stored on the cluster object.
460460
// NOTE: This value can be overridden while defining a Cluster.Topology using this MachinePoolClass.
461461
// +optional
462+
// +listType=atomic
462463
// +kubebuilder:validation:MaxItems=100
463464
// +kubebuilder:validation:items:MinLength=1
464465
// +kubebuilder:validation:items:MaxLength=256
@@ -653,6 +654,7 @@ type JSONSchemaProps struct {
653654
// required specifies which fields of an object are required.
654655
// NOTE: Can only be set if type is object.
655656
// +optional
657+
// +listType=atomic
656658
// +kubebuilder:validation:MaxItems=1000
657659
// +kubebuilder:validation:items:MinLength=1
658660
// +kubebuilder:validation:items:MaxLength=256
@@ -1051,6 +1053,7 @@ type PatchSelectorMatch struct {
10511053
type PatchSelectorMatchMachineDeploymentClass struct {
10521054
// names selects templates by class names.
10531055
// +optional
1056+
// +listType=atomic
10541057
// +kubebuilder:validation:MaxItems=100
10551058
// +kubebuilder:validation:items:MinLength=1
10561059
// +kubebuilder:validation:items:MaxLength=256
@@ -1062,6 +1065,7 @@ type PatchSelectorMatchMachineDeploymentClass struct {
10621065
type PatchSelectorMatchMachinePoolClass struct {
10631066
// names selects templates by class names.
10641067
// +optional
1068+
// +listType=atomic
10651069
// +kubebuilder:validation:MaxItems=100
10661070
// +kubebuilder:validation:items:MinLength=1
10671071
// +kubebuilder:validation:items:MaxLength=256

api/core/v1beta2/machinehealthcheck_types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ type MachineHealthCheckStatus struct {
231231

232232
// targets shows the current list of machines the machine health check is watching
233233
// +optional
234+
// +listType=atomic
234235
// +kubebuilder:validation:MaxItems=10000
235236
// +kubebuilder:validation:items:MinLength=1
236237
// +kubebuilder:validation:items:MaxLength=253

api/core/v1beta2/machinepool_types.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,15 @@ type MachinePoolSpec struct {
8686
// providerIDList are the identification IDs of machine instances provided by the provider.
8787
// This field must match the provider IDs as seen on the node objects corresponding to a machine pool's machine instances.
8888
// +optional
89+
// +listType=atomic
8990
// +kubebuilder:validation:MaxItems=10000
9091
// +kubebuilder:validation:items:MinLength=1
9192
// +kubebuilder:validation:items:MaxLength=512
9293
ProviderIDList []string `json:"providerIDList,omitempty"`
9394

9495
// failureDomains is the list of failure domains this MachinePool should be attached to.
9596
// +optional
97+
// +listType=atomic
9698
// +kubebuilder:validation:MaxItems=100
9799
// +kubebuilder:validation:items:MinLength=1
98100
// +kubebuilder:validation:items:MaxLength=256

0 commit comments

Comments
 (0)