Merge pull request #134830 from MatteoFari/matteofari/enable-jsontags-linter

enabled jsontags for kal and added exceptions because of non modifiable :Port
This commit is contained in:
Kubernetes Prow Robot 2026-01-30 17:55:42 +05:30 committed by GitHub
commit f4938574d4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 15 additions and 3 deletions

View file

@ -219,6 +219,10 @@ linters:
# OptionalOrRequired - Existing fields that are marked as both optional and required (based on standard optional vs kubebuilder:validation:Required) and should not be fixed.
- text: "field (PortStatus|IngressPortStatus)\\.Error must not be marked as both optional and required"
path: "staging/src/k8s.io/api/(core/v1|extensions/v1beta1|networking/(v1|v1beta1))"
# jsontags: 'Port' must be capitalized for backward compatibility
- text: 'jsontags: field DaemonEndpoint.Port json tag does not match'
path: "staging/src/k8s.io/api/core/v1/types.go"
- linters:
- forbidigo
@ -396,7 +400,7 @@ linters:
- "conditions" # Ensure conditions have the correct json tags and markers.
- "conflictingmarkers" # Detect mutually exclusive markers on the same field.
- "integers" # Ensure only int32 and int64 are used for integers.
# - "jsontags" # Ensure every field has a json tag.
- "jsontags" # Ensure every field has a json tag.
# - "maxlength" # Ensure all strings and arrays have maximum lengths/maximum items. ONLY for CRDs until declarative markers exist in core types.
# - "nobools" # Bools do not evolve over time, should use enums instead.
# - "nofloats" # Ensure floats are not used.

View file

@ -230,6 +230,10 @@ linters:
# OptionalOrRequired - Existing fields that are marked as both optional and required (based on standard optional vs kubebuilder:validation:Required) and should not be fixed.
- text: "field (PortStatus|IngressPortStatus)\\.Error must not be marked as both optional and required"
path: "staging/src/k8s.io/api/(core/v1|extensions/v1beta1|networking/(v1|v1beta1))"
# jsontags: 'Port' must be capitalized for backward compatibility
- text: 'jsontags: field DaemonEndpoint.Port json tag does not match'
path: "staging/src/k8s.io/api/core/v1/types.go"
- linters:
- forbidigo
@ -405,7 +409,7 @@ linters:
- "conditions" # Ensure conditions have the correct json tags and markers.
- "conflictingmarkers" # Detect mutually exclusive markers on the same field.
- "integers" # Ensure only int32 and int64 are used for integers.
# - "jsontags" # Ensure every field has a json tag.
- "jsontags" # Ensure every field has a json tag.
# - "maxlength" # Ensure all strings and arrays have maximum lengths/maximum items. ONLY for CRDs until declarative markers exist in core types.
# - "nobools" # Bools do not evolve over time, should use enums instead.
# - "nofloats" # Ensure floats are not used.

View file

@ -95,3 +95,7 @@
# OptionalOrRequired - Existing fields that are marked as both optional and required (based on standard optional vs kubebuilder:validation:Required) and should not be fixed.
- text: "field (PortStatus|IngressPortStatus)\\.Error must not be marked as both optional and required"
path: "staging/src/k8s.io/api/(core/v1|extensions/v1beta1|networking/(v1|v1beta1))"
# jsontags: 'Port' must be capitalized for backward compatibility
- text: 'jsontags: field DaemonEndpoint.Port json tag does not match'
path: "staging/src/k8s.io/api/core/v1/types.go"

View file

@ -7,7 +7,7 @@ linters:
- "conditions" # Ensure conditions have the correct json tags and markers.
- "conflictingmarkers" # Detect mutually exclusive markers on the same field.
- "integers" # Ensure only int32 and int64 are used for integers.
# - "jsontags" # Ensure every field has a json tag.
- "jsontags" # Ensure every field has a json tag.
# - "maxlength" # Ensure all strings and arrays have maximum lengths/maximum items. ONLY for CRDs until declarative markers exist in core types.
# - "nobools" # Bools do not evolve over time, should use enums instead.
# - "nofloats" # Ensure floats are not used.