Skip to content
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

Correctly parse X-Stream-Protocol-Version header #89857

Merged
merged 1 commit into from Apr 6, 2020

Conversation

tedyu
Copy link
Contributor

@tedyu tedyu commented Apr 4, 2020

What type of PR is this?
/kind bug

What this PR does / why we need it:
This PR iterates the components of X-Stream-Protocol-Version header and splits each by comma.
Non-empty protocol versions take part in negotiation.

Which issue(s) this PR fixes:
Fixes #89849

kube-apiserver: multiple comma-separated protocols in a single X-Stream-Protocol-Version header are now recognized, in addition to multiple headers, complying with RFC2616

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/bug Categorizes issue or PR as related to a bug. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Apr 4, 2020
@tedyu
Copy link
Contributor Author

tedyu commented Apr 4, 2020

/cc @liggitt

@k8s-ci-robot k8s-ci-robot added sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Apr 4, 2020
@liggitt
Copy link
Member

liggitt commented Apr 4, 2020

I would suggest putting the []string -> []string transform into its own function, unit testing it, then just doing something like:

clientProtocols := commaSeparatedHeaderValues(req.Header[http.CanonicalHeaderKey(HeaderProtocolVersion)])

@tedyu
Copy link
Contributor Author

tedyu commented Apr 4, 2020

@liggitt
PR has been updated with unit test

@tedyu
Copy link
Contributor Author

tedyu commented Apr 4, 2020

/priority important-soon

@k8s-ci-robot k8s-ci-robot added priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. and removed needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Apr 4, 2020
Signed-off-by: Ted Yu <yuzhihong@gmail.com>
@tedyu
Copy link
Contributor Author

tedyu commented Apr 4, 2020

/test pull-kubernetes-e2e-gce

@k8s-ci-robot
Copy link
Contributor

k8s-ci-robot commented Apr 4, 2020

@tedyu: The following test failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
pull-kubernetes-node-e2e-containerd 8aada68 link /test pull-kubernetes-node-e2e-containerd

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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. I understand the commands that are listed here.

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Apr 5, 2020
@liggitt
Copy link
Member

liggitt commented Apr 5, 2020

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 5, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: liggitt, tedyu

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 5, 2020
@k8s-ci-robot k8s-ci-robot merged commit b3db9d3 into kubernetes:master Apr 6, 2020
@k8s-ci-robot k8s-ci-robot added this to the v1.19 milestone Apr 6, 2020
k8s-ci-robot added a commit that referenced this pull request Nov 5, 2020
…f-#89857-upstream-release-1.18

Automated cherry pick of #89857: Correctly parse X-Stream-Protocol-Version header
k8s-ci-robot added a commit that referenced this pull request Nov 5, 2020
…f-#89857-upstream-release-1.17

Automated cherry pick of #89857: Correctly parse X-Stream-Protocol-Version header
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

X-Stream-Protocol-Version header is not parsed correctly
3 participants