From 892230280c7697bc6d9363330a1f727574c8a62d Mon Sep 17 00:00:00 2001 From: stefanprodan Date: Wed, 24 Jun 2020 09:25:30 +0300 Subject: [PATCH] Honour KUBECONFIG environment variable --- cmd/tk/main.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/tk/main.go b/cmd/tk/main.go index feadb81c..c0128a95 100644 --- a/cmd/tk/main.go +++ b/cmd/tk/main.go @@ -131,6 +131,10 @@ func kubeconfigFlag() { rootCmd.PersistentFlags().StringVarP(&kubeconfig, "kubeconfig", "", "", "absolute path to the kubeconfig file") } + + if len(os.Getenv("KUBECONFIG")) > 0 { + kubeconfig = os.Getenv("KUBECONFIG") + } } func generateDocs() {