Skip to content

Commit 64a1086

Browse files
authored
Merge pull request #1833 from brendandburns/master
Add interactive configuration to exec provider.
2 parents e8a10b1 + c9ad883 commit 64a1086

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

kubernetes/base/config/exec_provider.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,12 @@ def __init__(self, exec_config, cwd):
5757
self.cwd = cwd or None
5858

5959
def run(self, previous_response=None):
60+
is_interactive = sys.stdout.isatty()
6061
kubernetes_exec_info = {
6162
'apiVersion': self.api_version,
6263
'kind': 'ExecCredential',
6364
'spec': {
64-
'interactive': sys.stdout.isatty()
65+
'interactive': is_interactive
6566
}
6667
}
6768
if previous_response:
@@ -70,7 +71,8 @@ def run(self, previous_response=None):
7071
process = subprocess.Popen(
7172
self.args,
7273
stdout=subprocess.PIPE,
73-
stderr=subprocess.PIPE,
74+
stderr=sys.stderr if is_interactive else subprocess.PIPE,
75+
stdin=sys.stdin if is_interactive else None,
7476
cwd=self.cwd,
7577
env=self.env,
7678
universal_newlines=True)

0 commit comments

Comments
 (0)