func (c *ClusterPodRunner) ExecInPod(ctx context.Context, podName types.NamespacedName,
	contName string, command ...string) (stdout, stderr string, err error) {
	var (
		execOut bytes.Buffer
		execErr bytes.Buffer
	)
	err = c.postExec(podName, contName, command, &execOut, &execErr, nil)
	return execOut.String(), execErr.String(), err
}
ExecInPod executes arbitrary command inside of a pod and returns the output.
package cmds
import (
	"bytes"
	"context"
	"fmt"
	"io"
	"os"
	"strings"
	"github.com/go-logr/logr"
	corev1 "k8s.io/api/core/v1"
	"k8s.io/apimachinery/pkg/types"
	"k8s.io/client-go/kubernetes"
	"k8s.io/client-go/kubernetes/scheme"
	"k8s.io/client-go/rest"
	"k8s.io/client-go/tools/remotecommand"
)
type PodRunner interface {
	ExecInPod(ctx context.Context, podName types.NamespacedName, contName string, command ...string) (string, string, error)
	ExecVSQL(ctx context.Context, podName types.NamespacedName, contName string, command ...string) (string, string, error)
	ExecAdmintools(ctx context.Context, podName types.NamespacedName, contName string, command ...string) (string, string, error)
	CopyToPod(ctx context.Context, podName types.NamespacedName, contName string, sourceFile string,
		destFile string) (stdout, stderr string, err error)
}
type ClusterPodRunner struct {
	Log        logr.Logger
	Cfg        *rest.Config
	SUPassword string
}
func MakeClusterPodRunner(log logr.Logger, cfg *rest.Config, passwd string) *ClusterPodRunner {
	return &ClusterPodRunner{Log: log, Cfg: cfg, SUPassword: passwd}
}
func (c *ClusterPodRunner) logInfoCmd(podName types.NamespacedName, command ...string) {
	var sb strings.Builder
	for i := 0; i < len(command); i++ {
		switch command[i] {
		case "--password":
			sb.WriteString(command[i])
			sb.WriteString(" ")
			sb.WriteString("*******")
			i++
		default:
			sb.WriteString(command[i])
		}
		sb.WriteString(" ")
	}
	c.Log.Info("ExecInPod entry", "pod", podName, "command", sb.String())
}