From 8408e85a5f13a8da951e7b8d724f7a8d11b41923 Mon Sep 17 00:00:00 2001 From: Akshit Garg Date: Wed, 18 Jun 2025 14:28:25 +0530 Subject: [PATCH] Log every command run by the operator Signed-off-by: Akshit Garg --- percona/clientcmd/clientcmd.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/percona/clientcmd/clientcmd.go b/percona/clientcmd/clientcmd.go index 411e1a1551..c4bedb89fb 100644 --- a/percona/clientcmd/clientcmd.go +++ b/percona/clientcmd/clientcmd.go @@ -3,6 +3,7 @@ package clientcmd import ( "context" "io" + "log" "github.com/pkg/errors" corev1 "k8s.io/api/core/v1" @@ -52,6 +53,10 @@ func NewClient() (*Client, error) { func (c *Client) Exec(ctx context.Context, pod *corev1.Pod, containerName string, stdin io.Reader, stdout, stderr io.Writer, command ...string) error { // Prepare the API URL used to execute another process within the Pod. // In this case, we'll run a remote shell. + + log.Printf("Execing in pod namespace=%q, pod=%q, container=%q, command=%v\n", + pod.Namespace, pod.Name, containerName, command) + tty := false req := c.client.RESTClient(). Post().