INNER CODE UNIT · Go
init
mkubaczyk/helmsman · internal/app/main.go:38
func init() {
// Parse cli flags and read config files
flags.setup()
}
// resolveKubeconfigPath returns the active kubeconfig path: the -kubeconfig flag
// value if set, then the KUBECONFIG env var, then the default ~/.kube/config.
func resolveKubeconfigPath(f *cli) string {
if f.kubeconfig != "" {
return f.kubeconfig
}
if v := os.Getenv("KUBECONFIG"); v != "" {
return v
}
home, _ := os.UserHomeDir()
return filepath.Join(home, ".kube", "config")
}