diff --git a/k8s/client.go b/k8s/client.go index d42f6a0a11..f6173d11b4 100644 --- a/k8s/client.go +++ b/k8s/client.go @@ -433,11 +433,11 @@ func (c *Client) ExecInPod(ctx context.Context, namespace, pod, container string Command: command, }) if err != nil { - return bytes.Buffer{}, err + return bytes.Buffer{}, fmt.Errorf("error with exec request (pod=%s/%s, container=%s): %w", namespace, pod, container, err) } if errString := result.Stderr.String(); errString != "" { - return bytes.Buffer{}, fmt.Errorf("command failed: %s", errString) + return bytes.Buffer{}, fmt.Errorf("command failed (pod=%s/%s, container=%s): %q", namespace, pod, container, errString) } return result.Stdout, nil