Skip to content

Commit

Permalink
Merge pull request #116 from argoyle/read-all-configs
Browse files Browse the repository at this point in the history
Accumulate all readable configs
  • Loading branch information
justjanne authored Feb 26, 2019
2 parents ccb1f06 + fb907fe commit 6eeadd7
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 6eeadd7

Please sign in to comment.