diff --git a/kubernetes/client/api_client.py b/kubernetes/client/api_client.py index 7dca16a161..c51be2b8d0 100644 --- a/kubernetes/client/api_client.py +++ b/kubernetes/client/api_client.py @@ -346,7 +346,7 @@ def request(self, method, url, query_params=None, headers=None, """ # FIXME(dims) : We need a better way to figure out which # calls end up using web sockets - if url.endswith('/exec') and (method == "GET" or method == "POST"): + if (url.endswith('/exec') or url.endswith('/attach')) and (method == "GET" or method == "POST"): return ws_client.websocket_call(self.config, url, query_params=query_params, diff --git a/kubernetes/client/ws_client.py b/kubernetes/client/ws_client.py index 7177e5eb24..d29036c82b 100644 --- a/kubernetes/client/ws_client.py +++ b/kubernetes/client/ws_client.py @@ -234,7 +234,7 @@ def websocket_call(configuration, url, query_params, _request_timeout, if isinstance(commands, list): for command in commands: url += "&command=%s&" % quote_plus(command) - else: + elif commands is not None: url += '&command=' + quote_plus(commands) try: