-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Set Sec-WebSocket-Protocol header from cfg param #298
Conversation
kubernetes/client/ws_client.py
Outdated
@@ -46,6 +46,9 @@ def __init__(self, configuration, url, headers): | |||
if headers and 'authorization' in headers: | |||
header.append("authorization: %s" % headers['authorization']) | |||
|
|||
header.append("Sec-WebSocket-Protocol: %s" % |
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.
you should set (with a comment explaining what it is) and then here, check if it is not ws_streaming_protocol
to None
in configuration
objectNone
, set the header.
I see your other PR now. But please check for None
here.
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.
I'll add the none check.
Are you ok with keeping the default value in configuration.py or would you rather have it here?
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.
I think we should keep it in configuration
.
Hmmm so Success:
Fail:
I guess I could exclude the error channel from the concatenation into That last option would keep compatibility with existing code, while future proofing it a bit. (I wouldn't be surprised if more channels are added to the proto). What do you think? |
I like the later option that keeps compatibility. |
Tests are still failing, I guess this changed the behaviour of exec so exec tests need to be updated. Also need to make sure those behaviour changes are expected. |
Yeah I'm looking into that, the test expects the websocket's I'm having a hard time running the tests locally, is the required setup documented somewhere? |
Run a minikube locally and also make sure you installed all |
Updated the test to show an example of how to get the status message on the error channel. The test was failing because it expected the channel to be closed right after the 'exit', but now there's always a final status message that is sent down the error channel. Since calling
|
LGTM. I can squash all commits into one and merge it or you can squash them all into one (or as many it make sense logically). Thanks for your contribution to kubernetes python client. |
I think it should be good to go now. |
- Set Sec-WebSocket-Protocol header from cfg param - Add ERROR and RESIZE websocket channels As defined in pkg/kubelet/server/remotecommand/websocket.go - Adjust tests to show v4 behavior wtr to status message - Tweak read_all() to return only data from stdout and stderr.
This looks good but I am going to suggest a change. If you are not willing to do the change in this PR, I can merge it and send another PR for it. Instead of |
I think your suggestion makes sense, however I will not have time to adjust the PR until next week. |
That is OK. I will create an issue for these backward incompatible changes with swagger-codegen. If I didn't pick up the issue before next week, you can pick it up. For now, I will merge this. |
Follow up to:
(missing submodule bump)