10000 Merge pull request #180 from skuda/master · mbohlool/client-python@542facb · GitHub
[go: up one dir, main page]

Skip to content

Commit 542facb

Browse files
authored
Merge pull request kubernetes-client#180 from skuda/master
add support for attach api call using websockets.
2 parents 84fdbd7 + 5a590f8 commit 542facb

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

kubernetes/client/api_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ def request(self, method, url, query_params=None, headers=None,
346346
"""
347347
# FIXME(dims) : We need a better way to figure out which
348348
# calls end up using web sockets
349-
if url.endswith('/exec') and (method == "GET" or method == "POST"):
349+
if (url.endswith('/exec') or url.endswith('/attach')) and (method == "GET" or method == "POST"):
350350
return ws_client.websocket_call(self.config,
351351
url,
352352
query_params=query_params,

kubernetes/client/ws_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ def websocket_call(configuration, url, query_params, _request_timeout,
234234
if isinstance(commands, list):
235235
for command in commands:
236236
url += "&command=%s&" % quote_plus(command)
237-
else:
237+
elif commands is not None:
238238
url += '&command=' + quote_plus(commands)
239239

240240
try:

0 commit comments

Comments
 (0)
0