mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
Verifier does not support List
This commit is contained in:
parent
5ce7038488
commit
6c0b876a65
@ -57,6 +57,9 @@ var namespaceGVK = schema.GroupVersionKind{Group: "", Version: "v1", Kind: "Name
|
|||||||
// or if another error occurred. If the Open API V3 spec for a CRD is not
|
// or if another error occurred. If the Open API V3 spec for a CRD is not
|
||||||
// found, then the spec for Namespace is checked for query param support instead.
|
// found, then the spec for Namespace is checked for query param support instead.
|
||||||
func (v *queryParamVerifierV3) HasSupport(gvk schema.GroupVersionKind) error {
|
func (v *queryParamVerifierV3) HasSupport(gvk schema.GroupVersionKind) error {
|
||||||
|
if (gvk == schema.GroupVersionKind{Version: "v1", Kind: "List"}) {
|
||||||
|
return NewParamUnsupportedError(gvk, v.queryParam)
|
||||||
|
}
|
||||||
gvSpec, err := v.root.GVSpec(gvk.GroupVersion())
|
gvSpec, err := v.root.GVSpec(gvk.GroupVersion())
|
||||||
if err == nil {
|
if err == nil {
|
||||||
if supports := supportsQueryParamV3(gvSpec, gvk, v.queryParam); supports {
|
if supports := supportsQueryParamV3(gvSpec, gvk, v.queryParam); supports {
|
||||||
|
@ -104,6 +104,16 @@ func TestV3SupportsQueryParamBatchV1(t *testing.T) {
|
|||||||
queryParam: QueryParamFieldValidation,
|
queryParam: QueryParamFieldValidation,
|
||||||
expectedSupports: false,
|
expectedSupports: false,
|
||||||
},
|
},
|
||||||
|
"List GVK is specifically unsupported": {
|
||||||
|
crds: []schema.GroupKind{},
|
||||||
|
gvk: schema.GroupVersionKind{
|
||||||
|
Group: "",
|
||||||
|
Version: "v1",
|
||||||
|
Kind: "List",
|
||||||
|
},
|
||||||
|
queryParam: QueryParamFieldValidation,
|
||||||
|
expectedSupports: false,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
root := openapi3.NewRoot(cached.NewClient(openapitest.NewFileClient(t)))
|
root := openapi3.NewRoot(cached.NewClient(openapitest.NewFileClient(t)))
|
||||||
|
Loading…
Reference in New Issue
Block a user