From 2e34dd097909c9f01b1f2127468145fec8a49b6f Mon Sep 17 00:00:00 2001 From: Guy Arbitman Date: Mon, 25 Nov 2024 10:05:57 +0200 Subject: [PATCH] usm: nodejs: Fix linter issues (#31259) --- pkg/network/usm/nodejs.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pkg/network/usm/nodejs.go b/pkg/network/usm/nodejs.go index a47a213ff6382..8cdcb7b27d131 100644 --- a/pkg/network/usm/nodejs.go +++ b/pkg/network/usm/nodejs.go @@ -148,8 +148,11 @@ func (m *nodeJSMonitor) Start() { return } - m.attacher.Start() //nolint:errcheck // TODO - log.Info("Node JS TLS monitoring enabled") + if err := m.attacher.Start(); err != nil { + log.Errorf("cannot start nodeJS attacher: %s", err) + } else { + log.Info("Node JS TLS monitoring enabled") + } } // Stop the nodeJSMonitor. @@ -162,8 +165,8 @@ func (m *nodeJSMonitor) Stop() { m.attacher.Stop() } -// getNodeJSPath checks if the given PID is a NodeJS process and returns the path to the binary -func isNodeJSBinary(path string, procInfo *uprobes.ProcInfo) bool { //nolint:revive // TODO +// isNodeJSBinary returns true if the process is a NodeJS binary. +func isNodeJSBinary(_ string, procInfo *uprobes.ProcInfo) bool { exe, err := procInfo.Exe() if err != nil { return false