-
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
websocket: migrate to gorilla/websocket #103595
Conversation
Hi @stbenjam. 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. |
I'm generally in favor of this, will look. |
/ok-to-test |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: stbenjam The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This change migrates away from golang.org/x/net/websocket, in favor of github.com/gorilla/websocket. The main motivation for this change is I would like to run the e2e tests through a squid proxy to reach the remote cluster. Largely this just works, however the golang.org/x/net/websocket package does not support this and these tests fail for me when going through a proxy. The [docs for net/websocket](https://pkg.go.dev/golang.org/x/net/websocket) even point out that gorilla/websocket is more actively maintained and supports more features. gorilla/websocket is already available as well, so we're not introducing any additional dependencies.
@endocrimes Sure, rebased - thank you |
/test pull-kubernetes-unit Don't see an existing issue, but I can't imagine this is related to this PR:
|
/test pull-kubernetes-integration |
/retest |
/test all |
@stbenjam: The following tests failed, say
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. |
Thanks for the PR, but I'm -1 on switching from the golang.org dependency to this. We currently have a single transitive test-only dependency on that package via the etcd embedded test server. I'd rather see us drop that transitive dep and stop vendoring this, and pursue adding the proxy support to the golang.org/x/net impl |
The net package admits it's not "as actively maintained" as gorilla/websockets: https://pkg.go.dev/golang.org/x/net/websocket And it hasn't seen a commit in two years: https://github.com/golang/net/tree/master/websocket golang/go#18152 admits gorilla/websocket is the library basically everyone uses:
|
Yeah I kind of fall on @stbenjam's side here - I've seen that same perspective in the community w.r.t. net vs gorilla and "in the standard library" doesn't seem to be as strong of an argument as it should be. |
fwiw, gorilla/websocket has only seen ~2 functional changes in the last two years (gorilla/websocket@873e67e), so I'm not sure it is significantly more actively developed That said, that can also be seen as a sign of stability, and since gorilla/websocket has no dependencies outside the stdlib, it doesn't make our dependency story worse. |
golang.org/x/net/websocket is used in 10 test files and 3 non-test files... is the expectation that we would stop using it in all of those files? |
@stbenjam: PR needs rebase. 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. |
it seems that gorilla is looking for maintainers https://groups.google.com/d/msgid/golang-nuts/40a9cc71-8fa3-44a6-a2c4-f031358b99ffn%40googlegroups.com?utm_medium=email&utm_source=footer doesn't seem a good idea to migrate :/
|
Is this PR still needed, please rebase if so (or we can close it?) |
We can close it for now, especially in light of @aojea's comment /close |
@stbenjam: Closed this PR. In response to this:
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. |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
This change migrates away from golang.org/x/net/websocket, in favor
of github.com/gorilla/websocket. The main motivation for this change
is I would like to run the e2e tests through a squid proxy to reach
the remote cluster. Largely this just works, however the
golang.org/x/net/websocket package does not support this and these
tests fail for me when going through a proxy.
The docs for net/websocket
even point out that gorilla/websocket is more actively maintained and
supports more features.
gorilla/websocket is already available as well, so we're not introducing
any additional dependencies.
Which issue(s) this PR fixes:
N/A
Special notes for your reviewer:
N/A
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:
I'm using this squid configuration:
Launched as:
When using a proxy with golang.org/x/net/websocket, the tests fail:
With this PR: