@@ -57,48 +57,63 @@ linters:
57
57
- internal/api/.*
58
58
- " .*_test.go" # Exclude test files.
59
59
rules :
60
- # KAL should only run on API folders.
60
+ # # KAL should only run on API folders.
61
61
- path-except : " api//*"
62
62
linters :
63
63
- 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.
64
68
- 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/*"
65
69
text : " Conditions field must be a slice of metav1.Condition"
66
70
linters :
67
71
- 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
68
77
- path : " api/core/v1beta1/*"
69
78
text : " type ClusterIPFamily should not use an int, int8 or int16. Use int32 or int64 depending on bounding requirements"
70
79
linters :
71
80
- kubeapilinter
72
- - path : " api/ipam/v1beta2/*|api/ipam/ v1alpha1/*|api/ipam/v1beta1/*"
81
+ - path : " api/ipam/v1alpha1/*|api/ipam/v1beta1/*"
73
82
text : " field Prefix should not use an int, int8 or int16. Use int32 or int64 depending on bounding requirements"
74
83
linters :
75
84
- 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)
77
91
- path : " cmd/clusterctl/api/v1alpha3|api/runtime/hooks/v1alpha1"
78
92
text : " maxlength"
79
93
linters :
80
94
- 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
82
97
- path : " api/core/v1beta2/*|api/core/v1beta1/*"
83
98
text : " maxlength: field (AllOf|OneOf|AnyOf) must have a maximum items, add kubebuilder:validation:MaxItems marker"
84
99
linters :
85
100
- 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
92
103
- 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/*"
93
104
text : " nobools"
94
105
linters :
95
106
- 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.
97
110
- path : " api/core/v1beta2/*|api/core/v1beta1/*"
98
111
text : " field (XPreserveUnknownFields|XPreserveUnknownFields|XValidations|XMetadata|XIntOrString) json tag does not match pattern"
99
112
linters :
100
113
- 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.
102
117
- path : " api/bootstrap/kubeadm/v1beta2/kubeadm_types.go|api/bootstrap/kubeadm/v1beta1/kubeadm_types.go"
103
118
text : " field Token is marked as required, should not be a pointer"
104
119
linters :
@@ -107,10 +122,6 @@ linters:
107
122
text : " field Ref is marked as required, should not be a pointer"
108
123
linters :
109
124
- 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
114
125
issues :
115
126
max-same-issues : 0
116
127
max-issues-per-linter : 0
0 commit comments