-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Executing commands on a pod fails when only command kwarg is provided #312
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
Comments
Using 3.0.0 from pip and python3.6, I get the same issue. However, the workaround of supplying another parameter does not work for me. Is there something else I could try to get this working? My resulting URL is a bit more complex, but even "ls" fails for me:
|
Have you tried with 2.0.0? your url seems broken in a different way than mine was, you've got duplicated |
It seems my issue was the lack of the "container" parameter since there are two in my pod. However, I needed to run the command through curl to get that message back from the system:
It doesn't seem like the double ampersands cause any issue, but it's easily fixed by changing:
to
in ws_client.py. |
@eyeofthefrog nice catch. can you send a PR to fix ws_client.py? |
Yeah, I'll create one after my vacation. |
Done #346 |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Rotten issues close after 30d of inactivity. Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
@fejta-bot: Closing this issue. 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. |
When calling
connect_get_namespaced_pod_exec
and providing only the required arguments + command, e.g.connect_get_namespaced_pod_exec("mypod", "namespace", command="ls")
, I get the following exception:After debugging it, I found that the issue lies on how the query string is built for multiple values vs single ones:
The resulting url path + query string for the request above is:
/api/v1/namespaces/default/pods/mypod/exec&command=ls
Note the lack of
?
when starting the query string.But when giving another kwarg, e.g.
connect_get_namespaced_pod_exec("mypod", "namespace", command="ls", stderr=True)
, the call works fine.Note that this issue is specifically when using websockets. Relevant code is on
websocket_call
Here's a full example that reproduces my problem:
FTR, here's where I first asked for/got help #36
The text was updated successfully, but these errors were encountered: