Skip to content

Resolved the issue #2358 #2361

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions kubernetes/base/config/exec_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import os
import subprocess
import sys
import platform

from .config_exception import ConfigException

Expand Down Expand Up @@ -83,15 +84,17 @@ def run(self, previous_response=None):
kubernetes_exec_info['spec']['cluster'] = self.cluster.value

self.env['KUBERNETES_EXEC_INFO'] = json.dumps(kubernetes_exec_info)
is_windows = platform.system() == "Windows"
process = subprocess.Popen(
self.args,
stdout=subprocess.PIPE,
stderr=sys.stderr if is_interactive else subprocess.PIPE,
stdin=sys.stdin if is_interactive else None,
cwd=self.cwd,
env=self.env,
universal_newlines=True,
shell=self.shell)
self.args,
stdout=subprocess.PIPE,
stderr=sys.stderr if is_interactive else subprocess.PIPE,
stdin=sys.stdin if is_interactive else None,
cwd=self.cwd,
env=self.env,
universal_newlines=True,
shell=is_windows # Only use shell=True on Windows
)
(stdout, stderr) = process.communicate()
exit_code = process.wait()
if exit_code != 0:
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/base/stream/ws_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ def create_websocket(configuration, url, headers=None):
header.append("sec-websocket-protocol: %s" %
headers['sec-websocket-protocol'])
else:
header.append("sec-websocket-protocol: v4.channel.k8s.io")
header.append("sec-websocket-protocol: v5.channel.k8s.io")

if url.startswith('wss://') and configuration.verify_ssl:
ssl_opts = {
Expand Down
3 changes: 1 addition & 2 deletions kubernetes/base/watch/watch.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ def iter_resp_lines(resp):
line = buffer[:next_newline].decode(
"utf-8", errors="replace")
buffer = buffer[next_newline+1:]
if line:
yield line
yield line
next_newline = buffer.find(b'\n')


Expand Down