Home >Backend Development >Golang >Any equivalent/alternative for 'kubectl get Provisioner' in golang
We can use client-go to list the namespaces on the cluster, as follows:
clientset.CoreV1().Namespaces().List(context.TODO(), metav1.ListOptions{})
Is there a similar option for the kubectl get provisioner command? I know client-go doesn't have this feature, but are there any other custom features I can use?
You can retrieve the required resources by using sigs.k8s.io/controller-runtime/pkg/client
using unstructured objects.
refer to: https://pkg.go. dev/sigs.k8s.io/controller-runtime/pkg/client#example-Client-Get
The above is the detailed content of Any equivalent/alternative for 'kubectl get Provisioner' in golang. For more information, please follow other related articles on the PHP Chinese website!