Can anyone tell me how to list all namespaces in k8s using Go? I have been referencing this link but couldn't find anything that can list all namespaces.
Link: https://pkg.go.dev/github.com/gruntwork-io/terratest/modules/k8s
I don't see any ListNamespaces functions for the k8s package in Go.
Try kubernetes/client-go, you can do like
clientset.CoreV1().Namespaces("").List(context.TODO(), metav1.ListOptions{}). Yourclientsetmaybe instantiate within the cluster or outside.