From fb907fe0b45f1043c4e5aca22c2eb1d49aad2b52 Mon Sep 17 00:00:00 2001 From: Joakim Olsson Date: Tue, 19 Feb 2019 16:27:12 +0100 Subject: [PATCH] Accumulate all readable configs --- segment-kube.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/segment-kube.go b/segment-kube.go index 0fb1fa4a..85c69eab 100644 --- a/segment-kube.go +++ b/segment-kube.go @@ -55,8 +55,12 @@ func segmentKube(p *powerline) { paths := append(strings.Split(os.Getenv("KUBECONFIG"), ":"), path.Join(homePath(), ".kube", "config")) config := &KubeConfig{} for _, configPath := range paths { - if readKubeConfig(config, configPath) == nil { - break + temp := &KubeConfig{} + if readKubeConfig(temp, configPath) == nil { + config.Contexts = append(config.Contexts, temp.Contexts...) + if config.CurrentContext == "" { + config.CurrentContext = temp.CurrentContext + } } }