<p>I have below go code that print my kubernetes deployment metadata,</p>
<pre class="lang-golang prettyprint-override"><code>package test

import (
    &quot;context&quot;
    &quot;fmt&quot;
    &quot;os&quot;
    &quot;testing&quot;

    v1 &quot;k8s.io/apimachinery/pkg/apis/meta/v1&quot;
    &quot;k8s.io/client-go/kubernetes&quot;
    &quot;k8s.io/client-go/tools/clientcmd&quot;
)

func TestEksStandaloneModule(t *testing.T) {
    namespace := fmt.Sprintf(&quot;%v-%v&quot;, &quot;project&quot;, &quot;dit&quot;)
    kubeconfig := os.Getenv(&quot;HOME&quot;) + &quot;/KUBECONFIG&quot;

    clientCfg, err := clientcmd.BuildConfigFromFlags(&quot;&quot;, kubeconfig)
    if err != nil {
        t.Error(err)
    }

    clientset, err := kubernetes.NewForConfig(clientCfg)

    appDeployment, err := clientset.AppsV1().Deployments(namespace).Get(context.TODO(), &quot;deploymentname&quot;, v1.GetOptions{})
    fmt.Println(appDeployment)
}
</code></pre>
<p>Can any one please help me get a function that prints ingress metadata?
I am new to go.</p>

Simon
<p>I was able to make it work by</p>
<pre><code>appIngress, err := clientset.NetworkingV1().Ingresses(namespace).Get(context.TODO(), &quot;helloworldspringbootssl-ap145385&quot;, v1.GetOptions{})
fmt.Println(appIngress)
</code></pre>
