@@ -18,10 +18,12 @@ linters-settings:
18
18
enable :
19
19
- " conditions" # Ensure conditions have the correct json tags and markers.
20
20
- " integers" # Ensure only int32 and int64 are used for integers.
21
- - " statussubresource" # All root objects that have a `status` field should have a status subresource.
22
- - " nofloats" # Ensure floats are not used.
21
+ - " jsontags" # Ensure every field has a json tag.
23
22
- " maxlength" # Ensure all strings and arrays have maximum lengths/maximum items.
24
23
- " nobools" # Bools do not evolve over time, should use enums instead.
24
+ - " nofloats" # Ensure floats are not used.
25
+ - " requiredfields" # Required fields should not be pointers, and should not have `omitempty`.
26
+ - " statussubresource" # All root objects that have a `status` field should have a status subresource.
25
27
26
28
# Per discussion in July 2024, we are keeping phase fields for now.
27
29
# See https://github.com/kubernetes-sigs/cluster-api/pull/10897#discussion_r1685929508
@@ -30,7 +32,6 @@ linters-settings:
30
32
31
33
# Linters below this line are disabled, pending conversation on how and when to enable them.
32
34
# - "commentstart" # Ensure comments start with the serialized version of the field name.
33
- # - "jsontags" # Ensure every field has a json tag.
34
35
# - "optionalorrequired" # Every field should be marked as `+optional` or `+required`.
35
36
# - "requiredfields" # Required fields should not be pointers, and should not have `omitempty`.
36
37
disable :
@@ -82,3 +83,8 @@ issues:
82
83
text : " nobools"
83
84
linters :
84
85
- kal
86
+ # We follow the current CustomResourceDefinition field's json tag pattern.
87
+ - path : " api/v1beta1/*"
88
+ text : " field (XPreserveUnknownFields|XPreserveUnknownFields|XValidations|XMetadata|XIntOrString) json tag does not match pattern"
89
+ linters :
90
+ - kal
0 commit comments