Skip to content

Commit

Permalink
Implements azimuth-cloud#20
Browse files Browse the repository at this point in the history
  • Loading branch information
micafer committed Sep 23, 2024
1 parent d3bd9ef commit 929bb08
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pyhelm3/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ def __init__(
insecure_skip_tls_verify: bool = False,
kubeconfig: t.Optional[pathlib.Path] = None,
kubecontext: t.Optional[str] = None,
kubeapiserver: t.Optional[str] = None,
kubetoken: t.Optional[str] = None,
unpack_directory: t.Optional[str] = None
):
self._command = command or Command(
Expand All @@ -63,6 +65,8 @@ def __init__(
insecure_skip_tls_verify = insecure_skip_tls_verify,
kubeconfig = kubeconfig,
kubecontext = kubecontext,
kubeapiserver = kubeapiserver,
kubetoken = kubetoken,
unpack_directory = unpack_directory
)

Expand Down
8 changes: 8 additions & 0 deletions pyhelm3/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ def __init__(
insecure_skip_tls_verify: bool = False,
kubeconfig: t.Optional[pathlib.Path] = None,
kubecontext: t.Optional[str] = None,
kubeapiserver: t.Optional[str] = None,
kubetoken: t.Optional[str] = None,
unpack_directory: t.Optional[str] = None
):
self._logger = logging.getLogger(__name__)
Expand All @@ -154,6 +156,8 @@ def __init__(
self._insecure_skip_tls_verify = insecure_skip_tls_verify
self._kubeconfig = kubeconfig
self._kubecontext = kubecontext
self._kubeapiserver = kubeapiserver
self._kubetoken = kubetoken
self._unpack_directory = unpack_directory

def _log_format(self, argument):
Expand All @@ -174,6 +178,10 @@ async def run(self, command: t.List[str], input: t.Optional[bytes] = None) -> by
command.extend(["--kubeconfig", self._kubeconfig])
if self._kubecontext:
command.extend(["--kube-context", self._kubecontext])
if self._kubeapiserver:
command.extend(["--kube-apiserver", self._kubeapiserver])
if self._kubetoken:
command.extend(["--kube-token", self._kubetoken])
# The command must be made up of str and bytes, so convert anything that isn't
shell_formatted_command = shlex.join(
part if isinstance(part, (str, bytes)) else str(part)
Expand Down

0 comments on commit 929bb08

Please sign in to comment.