Skip to content

Commit

Permalink
fix: default namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
Telemaco019 committed May 19, 2024
1 parent 8b1a7df commit 93f8271
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,14 @@ func Execute() {
}

func init() {
defaultNamespace := "default"
defaultKubeconfig := ""
if home := homedir.HomeDir(); home != "" {
defaultKubeconfig = filepath.Join(home, ".kube", "config")
}

configFlags := genericclioptions.NewConfigFlags(true)
configFlags.KubeConfig = &defaultKubeconfig
configFlags.Namespace = &defaultNamespace
configFlags.AddFlags(rootCmd.PersistentFlags())
}

0 comments on commit 93f8271

Please sign in to comment.