Skip to content

Commit

Permalink
Add interactive configuration to exec provider.
Browse files Browse the repository at this point in the history
  • Loading branch information
brendandburns committed Jun 16, 2022
1 parent da50723 commit e0dfc6b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions kubernetes/base/config/exec_provider.py
Expand Up @@ -57,11 +57,12 @@ def __init__(self, exec_config, cwd):
self.cwd = cwd or None

def run(self, previous_response=None):
is_interactive = sys.stdout.isatty()
kubernetes_exec_info = {
'apiVersion': self.api_version,
'kind': 'ExecCredential',
'spec': {
'interactive': sys.stdout.isatty()
'interactive': is_interactive
}
}
if previous_response:
Expand All @@ -70,7 +71,8 @@ def run(self, previous_response=None):
process = subprocess.Popen(
self.args,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
stderr=sys.stderr when is_interactive else subprocess.PIPE,
stdin=sys.stdin when is_interactive else None,
cwd=self.cwd,
env=self.env,
universal_newlines=True)
Expand Down

0 comments on commit e0dfc6b

Please sign in to comment.