-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Split HTTPGetAction.Path into path and query #14273
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: nak3 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 |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #14273 +/- ##
==========================================
- Coverage 86.25% 86.21% -0.04%
==========================================
Files 199 199
Lines 14811 14813 +2
==========================================
- Hits 12775 12771 -4
- Misses 1734 1739 +5
- Partials 302 303 +1
☔ View full report in Codecov by Sentry. |
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.
Should we add an e2e test?
Sure, added the e2e test. |
Path: config.Path, | ||
} | ||
func getURL(config HTTPProbeConfigOptions) (*url.URL, error) { | ||
return url.Parse(string(config.Scheme) + "://" + net.JoinHostPort(config.Host, config.Port.String()) + config.Path) |
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.
Just for clarification, given the path /mypath?foo=bar
this is equivalent to constructing a URL with:
Path: "/mypath",
RawQuery: "foo=bar",
u.String() method indeed uses an escaped path only so it does not seem to have a way to avoid it. Also I think this is the proper way to do it as we want some parsing to happen instead of manually creating the URL.
As a side note, if the path has a special char it will be escaped which is legitimate wrt probes.
/lgtm /hold for @dprotaso |
/hold cancel thanks @nak3 🎉 |
Fixes #14267
corev1.HTTPGetAction
hasPath
which allows path and query like/mypath?foo=bar
.However, Golang's url.URL needs to split it into
Path
andRawQuery
otherwiseurl.String()
encodes?
into%3F
like #14267.Hence this patch fix it by split
corev1.HTTPGetAction.Path
intoPath
andRawQuery
.Release Note