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 <andrey.smirnov@siderolabs.com>
This commit is contained in:
Andrey Smirnov
2025-11-27 21:46:04 +04:00
committed by GitHub
parent bdc03ed540
commit 604e1675cf

View File

@@ -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 {