Skip to content

Commit

Permalink
Merge pull request #112 from h3poteto/fix/kubeconfig
Browse files Browse the repository at this point in the history
fix: Don't use kubeconfig when .kube/config file does not exist
  • Loading branch information
h3poteto authored Nov 26, 2020
2 parents 28bc5c5 + 9fbe339 commit 045bcde
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmd/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ func controllerConfig() (string, string) {
kubeconfig = os.Getenv("KUBECONFIG")
if kubeconfig == "" {
kubeconfig = "$HOME/.kube/config"
if _, err := os.Stat(kubeconfig); err != nil {
kubeconfig = ""
}
}
}
master := viper.GetString("master")
Expand Down

0 comments on commit 045bcde

Please sign in to comment.