Skip to content

Commit

Permalink
Merge pull request #116313 from seans3/verifier-skip-list
Browse files Browse the repository at this point in the history
QueryParamVerifier V3 does not support List
  • Loading branch information
k8s-ci-robot committed Mar 7, 2023
2 parents 8c61473 + 6c0b876 commit f461527
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
// found, then the spec for Namespace is checked for query param support instead.
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())
if err == nil {
if supports := supportsQueryParamV3(gvSpec, gvk, v.queryParam); supports {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,16 @@ func TestV3SupportsQueryParamBatchV1(t *testing.T) {
queryParam: QueryParamFieldValidation,
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)))
Expand Down

0 comments on commit f461527

Please sign in to comment.