Skip to content

Negotiate WebSocket v5 in the async exec client - #2797

Open
brendandburns wants to merge 1 commit into
kubernetes-client:masterfrom
brendandburns:agent/p2-issue-14
Open

brendandburns wants to merge 1 commit into
kubernetes-client:masterfrom
brendandburns:agent/p2-issue-14

Conversation

@brendandburns

Copy link
Copy Markdown
Contributor

Async exec offered only v4.channel.k8s.io, causing upgrade failures with servers requiring v5. The client now offers v5 with v4 fallback and handles v5 channel-close frames in buffered responses.

Negotiation: Use aiohttp’s subprotocol negotiation and preserve explicitly configured subprotocol headers.
Sec-WebSocket-Protocol: v5.channel.k8s.io,v4.channel.k8s.io
Channel closure: Buffered responses stop collecting data from a channel after its v5 close frame while continuing to collect other channels.
Raw streams: Return the unprocessed aiohttp WebSocket; callers remain responsible for channel framing and close messages.
Fixes brendandburns#14

Fixes: #2355

* fix: negotiate async WebSocket v5 with v4 fallback
@kubernetes-prow

Copy link
Copy Markdown
Contributor

Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

Details

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-sigs/prow repository.

@kubernetes-prow kubernetes-prow Bot added do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Nov 19, 2026
@kubernetes-prow
kubernetes-prow Bot requested review from roycaihw and yliaog November 19, 2026 02:41
@kubernetes-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: brendandburns
Once this PR has been reviewed and has the lgtm label, please assign yliaog for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details 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

@kubernetes-prow kubernetes-prow Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Nov 19, 2026
@aojea

aojea commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

I see, so we have two codepaths and we only have v5 implemented in one of the clients @yliaog ? #2486

@aojea

aojea commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

can we have an e2e test?

@yliaog

yliaog commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Yes, we have two, one sync, one async in the repo.

/assign @aojea

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[P2] Support WebSocket v5 negotiation in the async exec client sec-websocket-protocol header defaults to v4.channel.k8s.io causing HTTP 400

3 participants