<p>I have the following to exec into a pod to run a command</p>

<pre><code>fmt.Println("Running the command:", command)
parameterCodec := runtime.NewParameterCodec(scheme)
req.VersionedParams(&amp;corev1.PodExecOptions{
    Command:   strings.Fields(command),
    Stdin:     stdin != nil,
    Stdout:    true,
    Stderr:    true,
    TTY:       false,
}, parameterCodec)
</code></pre>

<p>I'm looking to run the same command but adding the <code>Container</code> option which is a string. I'm having a hard time figuring how how I can list all the containers in a pod. </p>

<p>Thanks</p>

Mike
<p>got it</p>

<pre><code>pod, err := clientset.CoreV1().Pods("default").Get(podname, metav1.GetOptions{})
if err != nil {
    return "", err
}

fmt.Println(pod.Spec.Containers[0])
</code></pre>
