-
Notifications
You must be signed in to change notification settings - Fork 39.9k
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
fix: remove case sensitive checking of probe headers #114606
fix: remove case sensitive checking of probe headers #114606
Conversation
Welcome @tuunit! |
Hi @tuunit. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
8dd6e4f
to
4b73463
Compare
bef61c2
to
798b1e6
Compare
@mrunalp @bobbypage anything I can do to further assist you with this PR? Is my explanation clear enough? If necessary I can add an actual deployment example that would fail without the fix. Happy christmas 🎄 |
/ok-to-test |
@tuunit please, squash your commits. otherwise lgtm |
/test pull-kubernetes-unit |
@bobbypage @mrunalp ready for final review 😄 Happy New Year 🥳 |
@bart0sh @bobbypage @mrunalp any updates on the when this will be reviewed / merged? |
/assign @derekwaynecarr @mrunalp @dchen1107 |
Any updates on the review? |
9f5d1c2
to
4a667a1
Compare
Any update on the review? @bobbypage @mrunalp @bart0sh @dchen1107 @derekwaynecarr |
@dchen1107 @bart0sh no new changes. Only a rebase of the latest changes on the master branch. |
/lgtm |
LGTM label has been added. Git tree hash: 2802f2178cf056d5043ec2f8129f49933d986ab3
|
Hey all, this PR has been open since December. Are there any concerns regarding the change or other reasons for that? |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mrunalp, tuunit 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 |
What type of PR is this?
/kind bug
What this PR does / why we need it:
This fixes a bug related to the default Accept header in probes introduced in release 1.20.
When I upgraded one of our older clusters from release 1.19 to one of the latest versions some of our readiness probes didn't work anymore. So I had a look into the code and realized in release 1.20 there was a change to include a default Accept header:
Original change: 0794bf6
Release notes: https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG/CHANGELOG-1.20.md
After this investigation, I checked the master branch and realized, that the issue is still present. The http.Header type from the "net/http" package is not properly used and therefore handling of the casing / capitalization of headers is not correctly done. Which leads to failing probes when a custom "Accept" header is defined with lower casing like so "accept".
Location of the issue:
kubernetes/pkg/probe/http/request.go
Lines 113 to 119 in 05a0ce8
The issue can be replicated with a simple go script, as it is related to how the http.Header type from the net/http package is used:
Special notes for your reviewer:
The currently proposed solution will enforce canonical keys for all headers. For example if a deployment defines a probe header with lowercasing like so "accept-encoding" it will be converted to "Accept-Encoding" and will be send in this format to the underlying application unlike before it was stored and send as "accept-encoding". Only the special cases of "Accept" and "User-Agent" where enforced to be in the canonical standard.
/sig node
/sig network
Does this PR introduce a user-facing change?