@@ -57,48 +57,63 @@ linters:
5757 - internal/api/.*
5858 - " .*_test.go" # Exclude test files.
5959 rules :
60- # KAL should only run on API folders.
60+ # # KAL should only run on API folders.
6161 - path-except : " api//*"
6262 linters :
6363 - kubeapilinter
64+
65+ # # Excludes that can be removed once v1alpha1/v1beta1 apiVersions are dropped
66+
67+ # .status.deprecated.v1beta1.conditions fields are using v1beta1.Condition types, these fields will be removed once v1alpha1/v1beta1 is removed.
6468 - path : " api/addons/v1beta2/*|api/bootstrap/kubeadm/v1beta2/*|api/controlplane/kubeadm/v1beta2/*|api/core/v1beta2/*|api/ipam/v1beta2/*|api/runtime/v1beta2/*|api/addons/v1beta1/*|api/bootstrap/kubeadm/v1beta1/*|api/controlplane/kubeadm/v1beta1/*|api/core/v1beta1/*|api/ipam/v1beta1/*|api/ipam/v1alpha1/*|api/runtime/v1alpha1/*"
6569 text : " Conditions field must be a slice of metav1.Condition"
6670 linters :
6771 - kubeapilinter
72+ - path : " api/core/v1beta2/*|api/core/v1beta1/*"
73+ text : " field Conditions type Conditions must have a maximum items, add kubebuilder:validation:MaxItems marker"
74+ linters :
75+ - kubeapilinter
76+ # excludes for v1alpha1/v1beta1 API packages
6877 - path : " api/core/v1beta1/*"
6978 text : " type ClusterIPFamily should not use an int, int8 or int16. Use int32 or int64 depending on bounding requirements"
7079 linters :
7180 - kubeapilinter
72- - path : " api/ipam/v1beta2/*|api/ipam/ v1alpha1/*|api/ipam/v1beta1/*"
81+ - path : " api/ipam/v1alpha1/*|api/ipam/v1beta1/*"
7382 text : " field Prefix should not use an int, int8 or int16. Use int32 or int64 depending on bounding requirements"
7483 linters :
7584 - kubeapilinter
76- # clusterctl and Runtime Hooks can be fixed once we bump their apiVersion.
85+ - path : " api/core/v1beta1/*"
86+ text : " field Addresses type MachineAddresses must have a maximum items, add kubebuilder:validation:MaxItems marker"
87+ linters :
88+ - kubeapilinter
89+
90+ # # Excludes for clusterctl and Runtime Hooks (can be fixed once we bump their apiVersion)
7791 - path : " cmd/clusterctl/api/v1alpha3|api/runtime/hooks/v1alpha1"
7892 text : " maxlength"
7993 linters :
8094 - kubeapilinter
81- # controller-gen does not allow to add MaxItems to Schemaless fields
95+
96+ # # controller-gen does not allow to add MaxItems to Schemaless fields
8297 - path : " api/core/v1beta2/*|api/core/v1beta1/*"
8398 text : " maxlength: field (AllOf|OneOf|AnyOf) must have a maximum items, add kubebuilder:validation:MaxItems marker"
8499 linters :
85100 - kubeapilinter
86- # It does not make sense to add a maxItems marker on the *List structs as they are not used to generate CRD YAMLs.
87- # This exclude will be removed once https://github.com/JoelSpeed/kubeapilinter/issues/38 is resolved.
88- - path : " api/core/v1beta2/*|api/addons/v1beta2/*|api/core/v1beta1/*|api/v1alpha1/*|api/addons/v1beta1/*"
89- text : " maxlength: field Items must have a maximum items, add kubebuilder:validation:MaxItems marker"
90- linters :
91- - kubeapilinter
101+
102+ # # Removal of bool fields of existing types requires further discussion
92103 - path : " api/bootstrap/kubeadm/v1beta2/*|api/controlplane/kubeadm/v1beta2/*|api/core/v1beta2/*|api/addons/v1beta2/*|api/bootstrap/kubeadm/v1beta1/*|api/controlplane/kubeadm/v1beta1/*|api/v1alpha1/*|api/core/v1beta1/*|api/addons/v1beta1/*"
93104 text : " nobools"
94105 linters :
95106 - kubeapilinter
96- # We follow the current CustomResourceDefinition field's json tag pattern.
107+
108+ # # Excludes for JSONSchemaProps
109+ # We want to align to the JSON tags of the CustomResourceDefinition fields.
97110 - path : " api/core/v1beta2/*|api/core/v1beta1/*"
98111 text : " field (XPreserveUnknownFields|XPreserveUnknownFields|XValidations|XMetadata|XIntOrString) json tag does not match pattern"
99112 linters :
100113 - kubeapilinter
101- # The following rules are disabled until we migrate to the new API.
114+
115+ # # TODO: The following rules are disabled until we migrate to the new API.
116+ # Note: Maybe this has to stay a pointer for marshalling reasons.
102117 - path : " api/bootstrap/kubeadm/v1beta2/kubeadm_types.go|api/bootstrap/kubeadm/v1beta1/kubeadm_types.go"
103118 text : " field Token is marked as required, should not be a pointer"
104119 linters :
@@ -107,10 +122,6 @@ linters:
107122 text : " field Ref is marked as required, should not be a pointer"
108123 linters :
109124 - kubeapilinter
110- - path : " api/core/v1beta2/*|api/addons/v1beta2/*|api/v1alpha1/*|api/core/v1beta1/*|api/v1alpha3/*|api/addons/v1beta1/*|api/runtime/v1beta2/*|api/runtime/v1alpha1/*|api/runtime/hooks/v1alpha1/*"
111- text : " field Items must be marked as optional or required"
112- linters :
113- - kubeapilinter
114125issues :
115126 max-same-issues : 0
116127 max-issues-per-linter : 0
0 commit comments