<p>How to get Kubectl get po -o yaml in golang</p>
<p>it to run this code
<a href="https://github.com/kubernetes/client-go/tree/master/examples/out-of-cluster-client-configuration" rel="nofollow noreferrer">Go client example</a></p>
<p>where the expected output is</p>
<pre><code>./app
There are 3 pods in the cluster
There are 3 pods in the cluster
There are 3 pods in the cluster
</code></pre>
<p>but when i run it i got</p>
<pre><code> go build -o app .
    ./app
panic: exec plugin: invalid apiVersion &quot;client.authentication.k8s.io/v1alpha1&quot;

goroutine 1 [running]:
main.main()
    /Users/padmanabanpr/Documents/client-go/examples/out-of-cluster-client-configuration/main.go:61 +0x5b6
</code></pre>

Pradeep Padmanaban C
<p>This might be due to your k8s client/server version being higher than 1.24+
<a href="https://github.com/aws/aws-cli/issues/6920" rel="nofollow noreferrer">https://github.com/aws/aws-cli/issues/6920</a> Please refer this for further clarification</p>
