From 2c92e1dcffc1cf609eb9432f13b9c1d2e488c735 Mon Sep 17 00:00:00 2001 From: Markus Lehtonen Date: Mon, 22 Aug 2022 14:39:52 +0300 Subject: [PATCH] logging: do not use %w with klog.Errorf It is not recognized (and does not work like with fmt.Errorf) so use %v instead. --- pkg/nfd-master/nfd-master.go | 6 +++--- pkg/resourcemonitor/noderesourcesaggregator.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/nfd-master/nfd-master.go b/pkg/nfd-master/nfd-master.go index 1084f11052..9b5e3775e0 100644 --- a/pkg/nfd-master/nfd-master.go +++ b/pkg/nfd-master/nfd-master.go @@ -490,7 +490,7 @@ func (m *nfdMaster) UpdateNodeTopology(c context.Context, r *topologypb.NodeTopo if !m.args.NoPublish { err := m.updateCR(r.NodeName, r.TopologyPolicies, r.Zones) if err != nil { - klog.Errorf("failed to advertise NodeResourceTopology: %w", err) + klog.Errorf("failed to advertise NodeResourceTopology: %v", err) return &topologypb.NodeTopologyResponse{}, err } } @@ -509,7 +509,7 @@ func (m *nfdMaster) crLabels(r *pb.SetLabelsRequest) map[string]string { }) if err != nil { - klog.Errorf("failed to list NodeFeatureRule resources: %w", err) + klog.Errorf("failed to list NodeFeatureRule resources: %v", err) return nil } @@ -525,7 +525,7 @@ func (m *nfdMaster) crLabels(r *pb.SetLabelsRequest) map[string]string { for _, rule := range spec.Spec.Rules { ruleOut, err := rule.Execute(r.Features) if err != nil { - klog.Errorf("failed to process Rule %q: %w", rule.Name, err) + klog.Errorf("failed to process Rule %q: %v", rule.Name, err) continue } diff --git a/pkg/resourcemonitor/noderesourcesaggregator.go b/pkg/resourcemonitor/noderesourcesaggregator.go index a3c4111d90..028d2c7f9c 100644 --- a/pkg/resourcemonitor/noderesourcesaggregator.go +++ b/pkg/resourcemonitor/noderesourcesaggregator.go @@ -415,7 +415,7 @@ func (noderesourceData *nodeResources) updateMemoryAvailable(numaData map[int]ma requestedSize, err := strconv.ParseInt(ri.Data[0], 10, 64) if err != nil { - klog.Errorf("failed to parse resource requested size: %w", err) + klog.Errorf("failed to parse resource requested size: %v", err) return }