in internal/kubectl.go [138:161]
func (c Kubectl) Exec(nsn types.NamespacedName, containerName string, cmd ...string) error {
execErrOut := io.Discard
if c.verbose {
execErrOut = c.errOut
}
options := &exec.ExecOptions{
StreamOptions: exec.StreamOptions{
IOStreams: genericclioptions.IOStreams{
In: nil,
Out: nil,
ErrOut: execErrOut,
},
Namespace: nsn.Namespace,
PodName: nsn.Name,
ContainerName: containerName,
},
Config: c.config,
PodClient: c.CoreV1(),
Command: cmd,
Executor: &exec.DefaultRemoteExecutor{},
}
return options.Run()
}