From 645a5163d48fa5d9d1c16dd8bcf51c765714eab9 Mon Sep 17 00:00:00 2001 From: Darren Shepherd Date: Fri, 18 Oct 2019 22:08:09 -0700 Subject: [PATCH] Only ignore get-kubeconfig error when !all If you are writing a script to launch k3s clusters checking the exit code of `get-kubeconfig` is an easy way to tell if the kubeconfig is available for use. --- cli/commands.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cli/commands.go b/cli/commands.go index 8ea82f9c..0268190c 100644 --- a/cli/commands.go +++ b/cli/commands.go @@ -379,6 +379,9 @@ func GetKubeConfig(c *cli.Context) error { for _, cluster := range clusters { kubeConfigPath, err := getKubeConfig(cluster.name) if err != nil { + if !c.Bool("all") { + return err + } log.Println(err) continue }