While testing out the demo cli I ran into an issue where the code was crashing as kubeconfig
flag was already defined ๐คท
Installing the cert-manager
Checking whether there are pods in the cluster...
Kubernetes configuration is set by $HOME/.kube/config.
/var/folders/0m/7r6d53g5459bqs669p047hq80000gn/T/go-build3997491302/b001/exe/main flag redefined: kubeconfig
panic: /var/folders/0m/7r6d53g5459bqs669p047hq80000gn/T/go-build3997491302/b001/exe/main flag redefined: kubeconfig
goroutine 1 [running]:
flag.(*FlagSet).Var(0x140000b6180, {0x102205db8, 0x1400041fad0}, {0x101cf338b, 0xa}, {0x101d2bfc3, 0x2f})
/usr/local/go/src/flag/flag.go:982 +0x2a4
flag.(*FlagSet).StringVar(...)
/usr/local/go/src/flag/flag.go:847
flag.(*FlagSet).String(0x14000569b08?, {0x101cf338b, 0xa}, {0x14000500160, 0x1f}, {0x101d2bfc3, 0x2f})
/usr/local/go/src/flag/flag.go:860 +0x9c
flag.String(...)
/usr/local/go/src/flag/flag.go:867
github.com/fischerjulian/a8s-demo/demo.GetKubernetesConfigPath()
/Users/abdulhaseeb/Desktop/Github/a9s-cli-v2/demo/pg_create.go:439 +0x10c
github.com/fischerjulian/a8s-demo/demo.GetKubernetesClientSet()
/Users/abdulhaseeb/Desktop/Github/a9s-cli-v2/demo/pg_create.go:456 +0x1c
github.com/fischerjulian/a8s-demo/demo.countPodsInNamespace({0x101cf61fd, 0xc})
/Users/abdulhaseeb/Desktop/Github/a9s-cli-v2/demo/pg_create.go:479 +0x38
github.com/fischerjulian/a8s-demo/demo.ApplyCertManagerManifests()
/Users/abdulhaseeb/Desktop/Github/a9s-cli-v2/demo/pg_create.go:564 +0x38
github.com/fischerjulian/a8s-demo/cmd.glob..func1(0x102c7b080?, {0x101ceacff?, 0x0?, 0x0?})
/Users/abdulhaseeb/Desktop/Github/a9s-cli-v2/cmd/a8s_pg_demo.go:45 +0xa4
github.com/spf13/cobra.(*Command).execute(0x102c7b080, {0x102cca9c0, 0x0, 0x0})
/Users/abdulhaseeb/go/pkg/mod/github.com/spf13/[email protected]/command.go:944 +0x5b0
github.com/spf13/cobra.(*Command).ExecuteC(0x102c7b360)
/Users/abdulhaseeb/go/pkg/mod/github.com/spf13/[email protected]/command.go:1068 +0x35c
github.com/spf13/cobra.(*Command).Execute(...)
/Users/abdulhaseeb/go/pkg/mod/github.com/spf13/[email protected]/command.go:992
github.com/fischerjulian/a8s-demo/cmd.Execute()
/Users/abdulhaseeb/Desktop/Github/a9s-cli-v2/cmd/root.go:25 +0x28
main.main()
/Users/abdulhaseeb/Desktop/Github/a9s-cli-v2/main.go:36 +0x40
exit status 2