Skip to content

Commit 4bc5347

Browse files
committed
Fix review findings
1 parent 911cbde commit 4bc5347

19 files changed

+67
-66
lines changed

.golangci-kal.yml

+1
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ issues:
8888
linters:
8989
- kal
9090
# It does not make sense to add a maxItems marker on the *List structs as they are not used to generate CRD YAMLs.
91+
# This exclude will be removed once https://github.com/JoelSpeed/kal/issues/38 is resolved.
9192
- path: "api/v1beta1/*"
9293
text: "maxlength: field Items must have a maximum items, add kubebuilder:validation:MaxItems marker"
9394
linters:

api/v1beta1/cluster_types.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -625,14 +625,14 @@ type WorkersTopology struct {
625625
// +optional
626626
// +listType=map
627627
// +listMapKey=name
628-
// +kubebuilder:validation:MaxItems=10000
628+
// +kubebuilder:validation:MaxItems=2000
629629
MachineDeployments []MachineDeploymentTopology `json:"machineDeployments,omitempty"`
630630

631631
// machinePools is a list of machine pools in the cluster.
632632
// +optional
633633
// +listType=map
634634
// +listMapKey=name
635-
// +kubebuilder:validation:MaxItems=10000
635+
// +kubebuilder:validation:MaxItems=2000
636636
MachinePools []MachinePoolTopology `json:"machinePools,omitempty"`
637637
}
638638

@@ -761,7 +761,7 @@ type MachinePoolTopology struct {
761761
// failureDomains is the list of failure domains the machine pool will be created in.
762762
// Must match a key in the FailureDomains map stored on the cluster object.
763763
// +optional
764-
// +kubebuilder:validation:MaxItems=1000
764+
// +kubebuilder:validation:MaxItems=100
765765
FailureDomains []string `json:"failureDomains,omitempty"`
766766

767767
// nodeDrainTimeout is the total amount of time that the controller will spend on draining a node.
@@ -885,7 +885,7 @@ type ClusterNetwork struct {
885885
// NetworkRanges represents ranges of network addresses.
886886
type NetworkRanges struct {
887887
// cidrBlocks is a list of CIDR blocks.
888-
// +kubebuilder:validation:MaxItems=1000
888+
// +kubebuilder:validation:MaxItems=100
889889
CIDRBlocks []string `json:"cidrBlocks"`
890890
}
891891

api/v1beta1/clusterclass_types.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -237,15 +237,15 @@ type WorkersClass struct {
237237
// +optional
238238
// +listType=map
239239
// +listMapKey=class
240-
// +kubebuilder:validation:MaxItems=1000
240+
// +kubebuilder:validation:MaxItems=100
241241
MachineDeployments []MachineDeploymentClass `json:"machineDeployments,omitempty"`
242242

243243
// machinePools is a list of machine pool classes that can be used to create
244244
// a set of worker nodes.
245245
// +optional
246246
// +listType=map
247247
// +listMapKey=class
248-
// +kubebuilder:validation:MaxItems=1000
248+
// +kubebuilder:validation:MaxItems=100
249249
MachinePools []MachinePoolClass `json:"machinePools,omitempty"`
250250
}
251251

@@ -420,7 +420,7 @@ type MachinePoolClass struct {
420420
// Must match a key in the FailureDomains map stored on the cluster object.
421421
// NOTE: This value can be overridden while defining a Cluster.Topology using this MachinePoolClass.
422422
// +optional
423-
// +kubebuilder:validation:MaxItems=1000
423+
// +kubebuilder:validation:MaxItems=100
424424
FailureDomains []string `json:"failureDomains,omitempty"`
425425

426426
// namingStrategy allows changing the naming pattern used when creating the MachinePool.
@@ -888,7 +888,7 @@ type ClusterClassPatch struct {
888888
// Note: Patches will be applied in the order of the array.
889889
// Note: Exactly one of Definitions or External must be set.
890890
// +optional
891-
// +kubebuilder:validation:MaxItems=1000
891+
// +kubebuilder:validation:MaxItems=100
892892
Definitions []PatchDefinition `json:"definitions,omitempty"`
893893

894894
// external defines an external patch.
@@ -905,7 +905,7 @@ type PatchDefinition struct {
905905
// jsonPatches defines the patches which should be applied on the templates
906906
// matching the selector.
907907
// Note: Patches will be applied in the order of the array.
908-
// +kubebuilder:validation:MaxItems=1000
908+
// +kubebuilder:validation:MaxItems=100
909909
JSONPatches []JSONPatch `json:"jsonPatches"`
910910
}
911911

@@ -955,7 +955,7 @@ type PatchSelectorMatch struct {
955955
type PatchSelectorMatchMachineDeploymentClass struct {
956956
// names selects templates by class names.
957957
// +optional
958-
// +kubebuilder:validation:MaxItems=1000
958+
// +kubebuilder:validation:MaxItems=100
959959
Names []string `json:"names,omitempty"`
960960
}
961961

@@ -964,7 +964,7 @@ type PatchSelectorMatchMachineDeploymentClass struct {
964964
type PatchSelectorMatchMachinePoolClass struct {
965965
// names selects templates by class names.
966966
// +optional
967-
// +kubebuilder:validation:MaxItems=1000
967+
// +kubebuilder:validation:MaxItems=100
968968
Names []string `json:"names,omitempty"`
969969
}
970970

api/v1beta1/machinehealthcheck_types.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ type MachineHealthCheckStatus struct {
166166

167167
// targets shows the current list of machines the machine health check is watching
168168
// +optional
169-
// +kubebuilder:validation:MaxItems=100000
169+
// +kubebuilder:validation:MaxItems=10000
170170
Targets []string `json:"targets,omitempty"`
171171

172172
// conditions defines current service state of the MachineHealthCheck.

bootstrap/kubeadm/api/v1beta1/kubeadm_types.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ type InitConfiguration struct {
6060
// The list of phases can be obtained with the "kubeadm init --help" command.
6161
// This option takes effect only on Kubernetes >=1.22.0.
6262
// +optional
63-
// +kubebuilder:validation:MaxItems=100
63+
// +kubebuilder:validation:MaxItems=50
6464
SkipPhases []string `json:"skipPhases,omitempty"`
6565

6666
// patches contains options related to applying patches to components deployed by kubeadm during
@@ -261,7 +261,7 @@ type NodeRegistrationOptions struct {
261261

262262
// ignorePreflightErrors provides a slice of pre-flight errors to be ignored when the current node is registered.
263263
// +optional
264-
// +kubebuilder:validation:MaxItems=100
264+
// +kubebuilder:validation:MaxItems=50
265265
IgnorePreflightErrors []string `json:"ignorePreflightErrors,omitempty"`
266266

267267
// imagePullPolicy specifies the policy for image pulling
@@ -428,7 +428,7 @@ type LocalEtcd struct {
428428
// Kubeadm has no knowledge of where certificate files live and they must be supplied.
429429
type ExternalEtcd struct {
430430
// endpoints of etcd members. Required for ExternalEtcd.
431-
// +kubebuilder:validation:MaxItems=100
431+
// +kubebuilder:validation:MaxItems=50
432432
Endpoints []string `json:"endpoints"`
433433

434434
// caFile is an SSL Certificate Authority file used to secure etcd communication.
@@ -477,7 +477,7 @@ type JoinConfiguration struct {
477477
// The list of phases can be obtained with the "kubeadm init --help" command.
478478
// This option takes effect only on Kubernetes >=1.22.0.
479479
// +optional
480-
// +kubebuilder:validation:MaxItems=100
480+
// +kubebuilder:validation:MaxItems=50
481481
SkipPhases []string `json:"skipPhases,omitempty"`
482482

483483
// patches contains options related to applying patches to components deployed by kubeadm during

bootstrap/kubeadm/api/v1beta1/kubeadmconfig_types.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ type KubeadmConfigSpec struct {
6565

6666
// files specifies extra files to be passed to user_data upon creation.
6767
// +optional
68-
// +kubebuilder:validation:MaxItems=1000
68+
// +kubebuilder:validation:MaxItems=200
6969
Files []File `json:"files,omitempty"`
7070

7171
// diskSetup specifies options for the creation of partition tables and file systems on devices.

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

+6-6
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

+6-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/addons.cluster.x-k8s.io_clusterresourcesetbindings.yaml

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/addons.cluster.x-k8s.io_clusterresourcesets.yaml

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/cluster.x-k8s.io_clusterclasses.yaml

+7-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/cluster.x-k8s.io_clusters.yaml

+5-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)