Skip to content

Commit

Permalink
style: log the kernel version
Browse files Browse the repository at this point in the history
Signed-off-by: Hunter Gregory <[email protected]>
  • Loading branch information
huntergregory committed Nov 5, 2024
1 parent 85dc587 commit b399ec0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions npm/pkg/dataplane/policies/chain-management_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,16 +282,16 @@ func (pMgr *PolicyManager) detectIptablesVersion() error {
}

if majorVersion >= 5 {

Check failure on line 284 in npm/pkg/dataplane/policies/chain-management_linux.go

View workflow job for this annotation

GitHub Actions / Lint (1.23.x, ubuntu-latest)

Magic number: 5, in <condition> detected (gomnd)

Check failure on line 284 in npm/pkg/dataplane/policies/chain-management_linux.go

View workflow job for this annotation

GitHub Actions / Lint (1.22.x, ubuntu-latest)

Magic number: 5, in <condition> detected (gomnd)
msg := "detected iptables version on third attempt. found kernel version >= 5. NPM will use iptables-nft"
klog.Info(msg)
metrics.SendLog(util.IptmID, msg, metrics.DonotPrint)
msg := "detected iptables version on third attempt. found kernel version >= 5. NPM will use iptables-nft. kernel version: %d"
klog.Infof(msg, majorVersion)
metrics.SendLog(util.IptmID, fmt.Sprintf(msg, majorVersion), metrics.DonotPrint)
util.SetIptablesToNft()
return nil
}

msg := "detected iptables version on third attempt. found kernel version < 5. NPM will use iptables-legacy"
klog.Info(msg)
metrics.SendLog(util.IptmID, msg, metrics.DonotPrint)
msg := "detected iptables version on third attempt. found kernel version < 5. NPM will use iptables-legacy. kernel version: %d"
klog.Infof(msg, majorVersion)
metrics.SendLog(util.IptmID, fmt.Sprintf(msg, majorVersion), metrics.DonotPrint)
util.SetIptablesToLegacy()
return nil
}
Expand Down

0 comments on commit b399ec0

Please sign in to comment.