Skip to content

Commit

Permalink
BUGFIX: fix correct ordering in sku add-config so that the given conf…
Browse files Browse the repository at this point in the history
…ig overrides the existing one
  • Loading branch information
skurfuerst committed Sep 21, 2021
1 parent dc2099e commit ce6c000
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/app/commands/add-config.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ It is basically doing what is explained in https://github.com/kubernetes/kuberne
kubeConfig := userHomeDir + "/.kube/config"

kubectlCommand := exec.Command("/usr/local/bin/kubectl", "config", "view", "--flatten")
kubectlCommand.Env = append(env, fmt.Sprintf(`KUBECONFIG=%s:%s`, kubeConfig, otherKubeconfigFile))
// the 1st kubeconfig file overrides the last one.
kubectlCommand.Env = append(env, fmt.Sprintf(`KUBECONFIG=%s:%s`, otherKubeconfigFile, kubeConfig))
output, err := kubectlCommand.Output()
if err != nil {
log.Fatal(err)
Expand All @@ -57,7 +58,6 @@ It is basically doing what is explained in https://github.com/kubernetes/kuberne
},
}


func init() {
RootCmd.AddCommand(addConfigCommand)
}

0 comments on commit ce6c000

Please sign in to comment.