mirror of
https://github.com/kubernetes/kubernetes.git
synced 2026-02-03 20:40:26 -05:00
api: enable optionalorrequired linter for node API
Add missing +required marker to RuntimeClass.Spec in node/v1alpha1 and enable the optionalorrequired linter for the node API group.
This commit is contained in:
parent
07a697046f
commit
50eb238457
5 changed files with 5 additions and 3 deletions
|
|
@ -214,7 +214,7 @@ linters:
|
|||
|
||||
# OptionalOrRequired is being enabled over time. For now, each API group should be added to this list until we comb through each group and fix the missing tags.
|
||||
- text: "must be marked as optional or required"
|
||||
path: "staging/src/k8s.io/api/(admission|apidiscovery|apiserverinternal|apps|authentication|authorization|autoscaling|batch|certificates|coordination|core|discovery|events|extensions|flowcontrol|networking|node|policy|rbac|resource|storage|storagemigration)"
|
||||
path: "staging/src/k8s.io/api/(admission|apidiscovery|apiserverinternal|apps|authentication|authorization|autoscaling|batch|certificates|coordination|core|discovery|events|extensions|flowcontrol|networking|policy|rbac|resource|storage|storagemigration)"
|
||||
|
||||
# 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"
|
||||
|
|
|
|||
|
|
@ -225,7 +225,7 @@ linters:
|
|||
|
||||
# OptionalOrRequired is being enabled over time. For now, each API group should be added to this list until we comb through each group and fix the missing tags.
|
||||
- text: "must be marked as optional or required"
|
||||
path: "staging/src/k8s.io/api/(admission|apidiscovery|apiserverinternal|apps|authentication|authorization|autoscaling|batch|certificates|coordination|core|discovery|events|extensions|flowcontrol|networking|node|policy|rbac|resource|storage|storagemigration)"
|
||||
path: "staging/src/k8s.io/api/(admission|apidiscovery|apiserverinternal|apps|authentication|authorization|autoscaling|batch|certificates|coordination|core|discovery|events|extensions|flowcontrol|networking|policy|rbac|resource|storage|storagemigration)"
|
||||
|
||||
# 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"
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@
|
|||
|
||||
# OptionalOrRequired is being enabled over time. For now, each API group should be added to this list until we comb through each group and fix the missing tags.
|
||||
- text: "must be marked as optional or required"
|
||||
path: "staging/src/k8s.io/api/(admission|apidiscovery|apiserverinternal|apps|authentication|authorization|autoscaling|batch|certificates|coordination|core|discovery|events|extensions|flowcontrol|networking|node|policy|rbac|resource|storage|storagemigration)"
|
||||
path: "staging/src/k8s.io/api/(admission|apidiscovery|apiserverinternal|apps|authentication|authorization|autoscaling|batch|certificates|coordination|core|discovery|events|extensions|flowcontrol|networking|policy|rbac|resource|storage|storagemigration)"
|
||||
|
||||
# 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"
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@ message RuntimeClass {
|
|||
|
||||
// spec represents specification of the RuntimeClass
|
||||
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
|
||||
// +required
|
||||
optional RuntimeClassSpec spec = 2;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ type RuntimeClass struct {
|
|||
|
||||
// spec represents specification of the RuntimeClass
|
||||
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
|
||||
// +required
|
||||
Spec RuntimeClassSpec `json:"spec" protobuf:"bytes,2,name=spec"`
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue