Skip to content

Commit

Permalink
Fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerrit91 committed Mar 20, 2024
1 parent 2d1699f commit b2415b2
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,14 @@ func initConfigWithViperCtx(cfg *config) error {
}
}

kubeconfigPath, err := helper.ExpandHomeDir(viper.GetString("kubeconfig"))
if err != nil {
return fmt.Errorf("unable to get kubeconfig path: %w", err)
}
if viper.IsSet("kubeconfig") {
kubeconfigPath, err := helper.ExpandHomeDir(viper.GetString("kubeconfig"))
if err != nil {
return fmt.Errorf("unable to get kubeconfig path: %w", err)
}

viper.Set("kubeconfig", kubeconfigPath)
viper.Set("kubeconfig", kubeconfigPath)
}

ctx := api.MustDefaultContext()

Expand Down

0 comments on commit b2415b2

Please sign in to comment.