From 604e1675cfe3fc87a2035ae015384b7a98df510e Mon Sep 17 00:00:00 2001 From: Andrey Smirnov Date: Thu, 27 Nov 2025 21:46:04 +0400 Subject: [PATCH] fix: kubernetes plugin logging (#7727) The plugin dropped the actual error message from the log, so the log becomes completely useless. Before: ``` [ERROR] plugin/kubernetes: error Failed to watch ``` After: ``` [ERROR] plugin/kubernetes: Failed to watch: failed to list *v1.Namespace: Get "https://10.96.0.1:443/api/v1/namespaces?limit=500&resourceVersion=0": tls: failed to parse certificate from server: x509: SAN dNSName is malformed ``` Signed-off-by: Andrey Smirnov --- plugin/kubernetes/logger.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin/kubernetes/logger.go b/plugin/kubernetes/logger.go index 6a6b04c18..1c239881b 100644 --- a/plugin/kubernetes/logger.go +++ b/plugin/kubernetes/logger.go @@ -25,8 +25,8 @@ func (l *loggerAdapter) Info(_ int, msg string, _ ...any) { l.P.Info(msg) } -func (l *loggerAdapter) Error(_ error, msg string, _ ...any) { - l.P.Error(msg) +func (l *loggerAdapter) Error(err error, msg string, _ ...any) { + l.Errorf("%s: %s", msg, err) } func (l *loggerAdapter) WithValues(_ ...any) logr.LogSink {