Skip to content

Commit

Permalink
Accumulate all readable configs
Browse files Browse the repository at this point in the history
  • Loading branch information
argoyle committed Feb 19, 2019
1 parent ccb1f06 commit fb907fe
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions segment-kube.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}

Expand Down

0 comments on commit fb907fe

Please sign in to comment.