<p>Is there a better way to list K8s Events that belong to a specific K8s Object?</p>
<p>For example, if I wanted to list all events that belonged to a Pod named &quot;podname&quot;, I'd do the following:</p>
<pre><code>opts := metav1.ListOptions{
    TypeMeta:      metav1.TypeMeta{Kind: &quot;Pod&quot;},
    FieldSelector: &quot;involvedObject.name=podname&quot;,
}
    
events, err := clientSet.CoreV1().Events(namespace).List(opts)
</code></pre>
<p>Is there a alternative/more idiomatic way in Go to filter by the kube object's name (instead of using a json-like string in FieldSelector)?</p>

Daniel W
<p>No, but a little bit better way is:</p>
<pre><code>fieldSelector, _ := fields.ParseSelector(&quot;involvedObject.name=podname,involvedObject.kind=Pod&quot;)
opts := metav1.ListOptions{FieldSelector: fieldSelector.String()}

events, err := clientSet.CoreV1().Events(namespace).List(opts)
</code></pre>
