From 7d9eca4644c2e7f303d9a7e420e2710b72b26989 Mon Sep 17 00:00:00 2001 From: adrianc Date: Thu, 9 Nov 2023 10:14:59 +0200 Subject: [PATCH] fix odd number of key-value in error logs a recent refactor to logging introduced these issues[1]. fix them to avoid panic during runtime [1] c155c82 Signed-off-by: adrianc --- pkg/daemon/daemon.go | 2 +- pkg/plugins/mellanox/mellanox_plugin.go | 2 +- pkg/systemd/systemd.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/daemon/daemon.go b/pkg/daemon/daemon.go index 3ec571924..1d435dc53 100644 --- a/pkg/daemon/daemon.go +++ b/pkg/daemon/daemon.go @@ -298,7 +298,7 @@ func (dn *Daemon) Run(stopCh <-chan struct{}, exitCh <-chan error) error { log.Log.V(0).Info("Run(): stop daemon") return nil case err, more := <-exitCh: - log.Log.Error(err, "got an error", err) + log.Log.Error(err, "got an error") if more { dn.refreshCh <- Message{ syncStatus: syncStatusFailed, diff --git a/pkg/plugins/mellanox/mellanox_plugin.go b/pkg/plugins/mellanox/mellanox_plugin.go index 4be72f1a6..5f9f9f56a 100644 --- a/pkg/plugins/mellanox/mellanox_plugin.go +++ b/pkg/plugins/mellanox/mellanox_plugin.go @@ -229,7 +229,7 @@ func getMlnxNicFwData(pciAddress string) (current, next *mlnxNic, err error) { out, err := utils.MstConfigReadData(pciAddress) if err != nil { - log.Log.Error(err, "mellanox-plugin getMlnxNicFwData(): failed", err) + log.Log.Error(err, "mellanox-plugin getMlnxNicFwData(): failed") return } mstCurrentData, mstNextData := utils.ParseMstconfigOutput(out, attrs) diff --git a/pkg/systemd/systemd.go b/pkg/systemd/systemd.go index 0bb23b576..87ae19a11 100644 --- a/pkg/systemd/systemd.go +++ b/pkg/systemd/systemd.go @@ -167,7 +167,7 @@ func WriteSriovResult(result *SriovResult) error { out, err := yaml.Marshal(result) if err != nil { - log.Log.Error(err, "WriteSriovResult(): failed to marshal sriov result", err) + log.Log.Error(err, "WriteSriovResult(): failed to marshal sriov result") return err }