mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-07-18 04:54:54 +00:00
Merge pull request #136492 from Ignoramuss/optionalorrequired-policy
api: enable optionalorrequired linter for policy API
This commit is contained in:
6
api/openapi-spec/swagger.json
generated
6
api/openapi-spec/swagger.json
generated
@@ -14882,12 +14882,6 @@
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"disruptionsAllowed",
|
||||
"currentHealthy",
|
||||
"desiredHealthy",
|
||||
"expectedPods"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"io.k8s.api.rbac.v1.AggregationRule": {
|
||||
|
||||
@@ -187,12 +187,6 @@
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"disruptionsAllowed",
|
||||
"currentHealthy",
|
||||
"desiredHealthy",
|
||||
"expectedPods"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"io.k8s.apimachinery.pkg.apis.meta.v1.APIResource": {
|
||||
|
||||
@@ -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|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|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|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|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|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|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"
|
||||
|
||||
2
pkg/generated/openapi/zz_generated.openapi.go
generated
2
pkg/generated/openapi/zz_generated.openapi.go
generated
@@ -43952,7 +43952,6 @@ func schema_k8sio_api_policy_v1_PodDisruptionBudgetStatus(ref common.ReferenceCa
|
||||
},
|
||||
},
|
||||
},
|
||||
Required: []string{"disruptionsAllowed", "currentHealthy", "desiredHealthy", "expectedPods"},
|
||||
},
|
||||
},
|
||||
Dependencies: []string{
|
||||
@@ -44229,7 +44228,6 @@ func schema_k8sio_api_policy_v1beta1_PodDisruptionBudgetStatus(ref common.Refere
|
||||
},
|
||||
},
|
||||
},
|
||||
Required: []string{"disruptionsAllowed", "currentHealthy", "desiredHealthy", "expectedPods"},
|
||||
},
|
||||
},
|
||||
Dependencies: []string{
|
||||
|
||||
@@ -142,15 +142,19 @@ message PodDisruptionBudgetStatus {
|
||||
map<string, .k8s.io.apimachinery.pkg.apis.meta.v1.Time> disruptedPods = 2;
|
||||
|
||||
// Number of pod disruptions that are currently allowed.
|
||||
// +optional
|
||||
optional int32 disruptionsAllowed = 3;
|
||||
|
||||
// current number of healthy pods
|
||||
// +optional
|
||||
optional int32 currentHealthy = 4;
|
||||
|
||||
// minimum desired number of healthy pods
|
||||
// +optional
|
||||
optional int32 desiredHealthy = 5;
|
||||
|
||||
// total number of pods counted by this disruption budget
|
||||
// +optional
|
||||
optional int32 expectedPods = 6;
|
||||
|
||||
// Conditions contain conditions for PDB. The disruption controller sets the
|
||||
|
||||
@@ -117,15 +117,19 @@ type PodDisruptionBudgetStatus struct {
|
||||
DisruptedPods map[string]metav1.Time `json:"disruptedPods,omitempty" protobuf:"bytes,2,rep,name=disruptedPods"`
|
||||
|
||||
// Number of pod disruptions that are currently allowed.
|
||||
// +optional
|
||||
DisruptionsAllowed int32 `json:"disruptionsAllowed" protobuf:"varint,3,opt,name=disruptionsAllowed"`
|
||||
|
||||
// current number of healthy pods
|
||||
// +optional
|
||||
CurrentHealthy int32 `json:"currentHealthy" protobuf:"varint,4,opt,name=currentHealthy"`
|
||||
|
||||
// minimum desired number of healthy pods
|
||||
// +optional
|
||||
DesiredHealthy int32 `json:"desiredHealthy" protobuf:"varint,5,opt,name=desiredHealthy"`
|
||||
|
||||
// total number of pods counted by this disruption budget
|
||||
// +optional
|
||||
ExpectedPods int32 `json:"expectedPods" protobuf:"varint,6,opt,name=expectedPods"`
|
||||
|
||||
// Conditions contain conditions for PDB. The disruption controller sets the
|
||||
|
||||
@@ -142,15 +142,19 @@ message PodDisruptionBudgetStatus {
|
||||
map<string, .k8s.io.apimachinery.pkg.apis.meta.v1.Time> disruptedPods = 2;
|
||||
|
||||
// Number of pod disruptions that are currently allowed.
|
||||
// +optional
|
||||
optional int32 disruptionsAllowed = 3;
|
||||
|
||||
// current number of healthy pods
|
||||
// +optional
|
||||
optional int32 currentHealthy = 4;
|
||||
|
||||
// minimum desired number of healthy pods
|
||||
// +optional
|
||||
optional int32 desiredHealthy = 5;
|
||||
|
||||
// total number of pods counted by this disruption budget
|
||||
// +optional
|
||||
optional int32 expectedPods = 6;
|
||||
|
||||
// Conditions contain conditions for PDB. The disruption controller sets the
|
||||
|
||||
@@ -114,15 +114,19 @@ type PodDisruptionBudgetStatus struct {
|
||||
DisruptedPods map[string]metav1.Time `json:"disruptedPods,omitempty" protobuf:"bytes,2,rep,name=disruptedPods"`
|
||||
|
||||
// Number of pod disruptions that are currently allowed.
|
||||
// +optional
|
||||
DisruptionsAllowed int32 `json:"disruptionsAllowed" protobuf:"varint,3,opt,name=disruptionsAllowed"`
|
||||
|
||||
// current number of healthy pods
|
||||
// +optional
|
||||
CurrentHealthy int32 `json:"currentHealthy" protobuf:"varint,4,opt,name=currentHealthy"`
|
||||
|
||||
// minimum desired number of healthy pods
|
||||
// +optional
|
||||
DesiredHealthy int32 `json:"desiredHealthy" protobuf:"varint,5,opt,name=desiredHealthy"`
|
||||
|
||||
// total number of pods counted by this disruption budget
|
||||
// +optional
|
||||
ExpectedPods int32 `json:"expectedPods" protobuf:"varint,6,opt,name=expectedPods"`
|
||||
|
||||
// Conditions contain conditions for PDB. The disruption controller sets the
|
||||
|
||||
Reference in New Issue
Block a user