mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-07-17 20:00:07 +00:00
Merge pull request #135470 from Ignoramuss/optionalorrequired-scheduling
api: add +required markers to scheduling API
This commit is contained in:
3
api/openapi-spec/swagger.json
generated
3
api/openapi-spec/swagger.json
generated
@@ -19029,9 +19029,6 @@
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"value"
|
||||
],
|
||||
"type": "object",
|
||||
"x-kubernetes-group-version-kind": [
|
||||
{
|
||||
|
||||
@@ -40,9 +40,6 @@
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"value"
|
||||
],
|
||||
"type": "object",
|
||||
"x-kubernetes-group-version-kind": [
|
||||
{
|
||||
|
||||
@@ -211,6 +211,14 @@ linters:
|
||||
path: "staging/src/k8s.io/api/resource/(v1|v1beta2)/types.go"
|
||||
- text: "field (CapacityRequirements.Requests|DeviceRequestAllocationResult.ConsumedCapacity) should not use a map type, use a list type with a unique name/identifier instead"
|
||||
path: "staging/src/k8s.io/api/resource/(v1|v1beta1|v1beta2)/types.go"
|
||||
|
||||
# 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|imagepolicy|networking|node|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"
|
||||
path: "staging/src/k8s.io/api/(core/v1|extensions/v1beta1|networking/(v1|v1beta1))"
|
||||
|
||||
- linters:
|
||||
- forbidigo
|
||||
@@ -396,7 +404,7 @@ linters:
|
||||
# - "nophase" # Ensure field names do not have the word "phase" in them.
|
||||
- "notimestamp" # Ensure fields are not named "timestamp", prefer "time".
|
||||
# - "optionalfields" # Ensure fields marked optional have omitempty and pointers.
|
||||
# - "optionalorrequired" # Every field should be marked as `+optional` xor `+required`.
|
||||
- "optionalorrequired" # Every field should be marked as `+optional` xor `+required`.
|
||||
# - "requiredfields" # Required fields should only be pointers when required based on the validity of the zero value, they should always have `omitempty`.
|
||||
- "ssatags" # Ensure lists have a listType tag.
|
||||
# - "uniquemarkers" # Ensure markers are not duplicated across field and type definitions.
|
||||
|
||||
@@ -222,6 +222,14 @@ linters:
|
||||
path: "staging/src/k8s.io/api/resource/(v1|v1beta2)/types.go"
|
||||
- text: "field (CapacityRequirements.Requests|DeviceRequestAllocationResult.ConsumedCapacity) should not use a map type, use a list type with a unique name/identifier instead"
|
||||
path: "staging/src/k8s.io/api/resource/(v1|v1beta1|v1beta2)/types.go"
|
||||
|
||||
# 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|imagepolicy|networking|node|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"
|
||||
path: "staging/src/k8s.io/api/(core/v1|extensions/v1beta1|networking/(v1|v1beta1))"
|
||||
|
||||
- linters:
|
||||
- forbidigo
|
||||
@@ -405,7 +413,7 @@ linters:
|
||||
# - "nophase" # Ensure field names do not have the word "phase" in them.
|
||||
- "notimestamp" # Ensure fields are not named "timestamp", prefer "time".
|
||||
# - "optionalfields" # Ensure fields marked optional have omitempty and pointers.
|
||||
# - "optionalorrequired" # Every field should be marked as `+optional` xor `+required`.
|
||||
- "optionalorrequired" # Every field should be marked as `+optional` xor `+required`.
|
||||
# - "requiredfields" # Required fields should only be pointers when required based on the validity of the zero value, they should always have `omitempty`.
|
||||
- "ssatags" # Ensure lists have a listType tag.
|
||||
# - "uniquemarkers" # Ensure markers are not duplicated across field and type definitions.
|
||||
|
||||
@@ -86,4 +86,12 @@
|
||||
- text: "field Device.(Attributes|Capacity) should not use a map type, use a list type with a unique name/identifier instead"
|
||||
path: "staging/src/k8s.io/api/resource/(v1|v1beta2)/types.go"
|
||||
- text: "field (CapacityRequirements.Requests|DeviceRequestAllocationResult.ConsumedCapacity) should not use a map type, use a list type with a unique name/identifier instead"
|
||||
path: "staging/src/k8s.io/api/resource/(v1|v1beta1|v1beta2)/types.go"
|
||||
path: "staging/src/k8s.io/api/resource/(v1|v1beta1|v1beta2)/types.go"
|
||||
|
||||
# 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|imagepolicy|networking|node|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"
|
||||
path: "staging/src/k8s.io/api/(core/v1|extensions/v1beta1|networking/(v1|v1beta1))"
|
||||
|
||||
@@ -16,7 +16,7 @@ linters:
|
||||
# - "nophase" # Ensure field names do not have the word "phase" in them.
|
||||
- "notimestamp" # Ensure fields are not named "timestamp", prefer "time".
|
||||
# - "optionalfields" # Ensure fields marked optional have omitempty and pointers.
|
||||
# - "optionalorrequired" # Every field should be marked as `+optional` xor `+required`.
|
||||
- "optionalorrequired" # Every field should be marked as `+optional` xor `+required`.
|
||||
# - "requiredfields" # Required fields should only be pointers when required based on the validity of the zero value, they should always have `omitempty`.
|
||||
- "ssatags" # Ensure lists have a listType tag.
|
||||
# - "uniquemarkers" # Ensure markers are not duplicated across field and type definitions.
|
||||
|
||||
3
pkg/generated/openapi/zz_generated.openapi.go
generated
3
pkg/generated/openapi/zz_generated.openapi.go
generated
@@ -53207,7 +53207,6 @@ func schema_k8sio_api_scheduling_v1_PriorityClass(ref common.ReferenceCallback)
|
||||
},
|
||||
},
|
||||
},
|
||||
Required: []string{"value"},
|
||||
},
|
||||
},
|
||||
Dependencies: []string{
|
||||
@@ -53416,7 +53415,6 @@ func schema_k8sio_api_scheduling_v1alpha1_PriorityClass(ref common.ReferenceCall
|
||||
},
|
||||
},
|
||||
},
|
||||
Required: []string{"value"},
|
||||
},
|
||||
},
|
||||
Dependencies: []string{
|
||||
@@ -53710,7 +53708,6 @@ func schema_k8sio_api_scheduling_v1beta1_PriorityClass(ref common.ReferenceCallb
|
||||
},
|
||||
},
|
||||
},
|
||||
Required: []string{"value"},
|
||||
},
|
||||
},
|
||||
Dependencies: []string{
|
||||
|
||||
@@ -39,6 +39,7 @@ message PriorityClass {
|
||||
|
||||
// value represents the integer value of this priority class. This is the actual priority that pods
|
||||
// receive when they have the name of this class in their pod spec.
|
||||
// +optional
|
||||
optional int32 value = 2;
|
||||
|
||||
// globalDefault specifies whether this PriorityClass should be considered as
|
||||
|
||||
@@ -37,6 +37,7 @@ type PriorityClass struct {
|
||||
|
||||
// value represents the integer value of this priority class. This is the actual priority that pods
|
||||
// receive when they have the name of this class in their pod spec.
|
||||
// +optional
|
||||
Value int32 `json:"value" protobuf:"bytes,2,opt,name=value"`
|
||||
|
||||
// globalDefault specifies whether this PriorityClass should be considered as
|
||||
|
||||
@@ -94,6 +94,7 @@ message PriorityClass {
|
||||
|
||||
// value represents the integer value of this priority class. This is the actual priority that pods
|
||||
// receive when they have the name of this class in their pod spec.
|
||||
// +optional
|
||||
optional int32 value = 2;
|
||||
|
||||
// globalDefault specifies whether this PriorityClass should be considered as
|
||||
|
||||
@@ -37,6 +37,7 @@ type PriorityClass struct {
|
||||
|
||||
// value represents the integer value of this priority class. This is the actual priority that pods
|
||||
// receive when they have the name of this class in their pod spec.
|
||||
// +optional
|
||||
Value int32 `json:"value" protobuf:"bytes,2,opt,name=value"`
|
||||
|
||||
// globalDefault specifies whether this PriorityClass should be considered as
|
||||
|
||||
@@ -40,6 +40,7 @@ message PriorityClass {
|
||||
|
||||
// value represents the integer value of this priority class. This is the actual priority that pods
|
||||
// receive when they have the name of this class in their pod spec.
|
||||
// +optional
|
||||
optional int32 value = 2;
|
||||
|
||||
// globalDefault specifies whether this PriorityClass should be considered as
|
||||
|
||||
@@ -41,6 +41,7 @@ type PriorityClass struct {
|
||||
|
||||
// value represents the integer value of this priority class. This is the actual priority that pods
|
||||
// receive when they have the name of this class in their pod spec.
|
||||
// +optional
|
||||
Value int32 `json:"value" protobuf:"bytes,2,opt,name=value"`
|
||||
|
||||
// globalDefault specifies whether this PriorityClass should be considered as
|
||||
|
||||
Reference in New Issue
Block a user