Skip to content

Commit

Permalink
BugFix: Check if the returend ExecCredential has env field
Browse files Browse the repository at this point in the history
  • Loading branch information
raminqaf authored and gtsystem committed Dec 16, 2024
1 parent 5f8b087 commit b825f59
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lightkube/config/client_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ def _prepare(self):
f"auth exec api version {exec.apiVersion} not implemented"
)
cmd_env_vars = dict(os.environ)
cmd_env_vars.update((var.name, var.value) for var in exec.env)
if exec.env:
cmd_env_vars.update((var.name, var.value) for var in exec.env)
# TODO: add support for passing KUBERNETES_EXEC_INFO env var
# https://github.com/kubernetes/community/blob/master/contributors/design-proposals/auth/kubectl-exec-plugins.md
args = exec.args if exec.args else []
Expand Down

0 comments on commit b825f59

Please sign in to comment.