-
Notifications
You must be signed in to change notification settings - Fork 38.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automated cherry pick of #117768: QueryParamVerifierV3 resilient to minimal OpenAPI V3 #117796: QueryParamVerifier falls back on invalid v3 document #117918
Automated cherry pick of #117768: QueryParamVerifierV3 resilient to minimal OpenAPI V3 #117796: QueryParamVerifier falls back on invalid v3 document #117918
Conversation
/kind bug |
/cc @apelisse |
/lgtm |
LGTM label has been added. Git tree hash: 6c98ea2dd4bc58518158d88c2a12f42820d874d9
|
/retest unrelated error |
/assign @liggitt |
/cc kubernetes/release-managers |
} | ||
return false | ||
return NewParamUnsupportedError(gvk, queryParam) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is an improvement over the current state of release-1.27, so merging it seems fine, but I'd like to see a follow-up in master: if we don't find the path we want in the openapi v3 doc (if we fall through to line 130 here), we should return an error about the path not being found, not at definite NewParamUnsupportedError answer, right?
Otherwise, a stub openapi v3 doc like paths:{}
, or paths:{"/version":{"get":...}}
wouldn't fall back to v2
"empty document returns error": { | ||
spec: &spec3.OpenAPI{}, | ||
}, | ||
"minimal document returns error": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in the follow-up in master, include more minimal/stub documents we could encounter that should fall back to v2:
Paths: &Paths{}
Paths: &Paths{Paths: map[string]*Path{"/version":nil}}
Paths: &Paths{Paths: map[string]*Path{"/version":&Path{}}}
/lgtm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As per #117770 this is only affecting 1.27
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: apelisse, liggitt, seans3, xmudrii The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Cherry pick of #117768 #117796 on release-1.27.
#117768: QueryParamVerifierV3 resilient to minimal OpenAPI V3
#117796: QueryParamVerifier fallsback when error retrieving OpenAPI V3 document
Fixes #117762
For details on the cherry pick process, see the cherry pick requests page.