From eb8ac7d3dfd4892bac1924e5cd4d8fa556fc7c4a Mon Sep 17 00:00:00 2001 From: Sebastiaan Tammer Date: Mon, 27 May 2019 00:22:35 +0200 Subject: [PATCH] Added kubeconfig option to Pod and Container shell commands --- internal/views/container.go | 1 + internal/views/pod.go | 1 + 2 files changed, 2 insertions(+) diff --git a/internal/views/container.go b/internal/views/container.go index 41523a6e..59bf9cdb 100644 --- a/internal/views/container.go +++ b/internal/views/container.go @@ -88,6 +88,7 @@ func (v *containerView) shellIn(path, co string) { args = append(args, "exec", "-it") args = append(args, "--context", v.app.config.K9s.CurrentContext) args = append(args, "-n", ns) + args = append(args, "--kubeconfig", *v.app.config.GetConnection().Config().Flags().KubeConfig) args = append(args, po) if len(co) != 0 { args = append(args, "-c", co) diff --git a/internal/views/pod.go b/internal/views/pod.go index 4f194f3e..9093db8b 100644 --- a/internal/views/pod.go +++ b/internal/views/pod.go @@ -181,6 +181,7 @@ func (v *podView) shellIn(path, co string) { args = append(args, "exec", "-it") args = append(args, "--context", v.app.config.K9s.CurrentContext) args = append(args, "-n", ns) + args = append(args, "--kubeconfig", *v.app.config.GetConnection().Config().Flags().KubeConfig) args = append(args, po) if len(co) != 0 { args = append(args, "-c", co)