Conversation
Replaced to use join host port for support in v6. Issue: None Signed-off-by: Bari <bari@lightbitslabs.com>
📝 WalkthroughWalkthroughThe update modifies how network endpoint addresses are constructed in the ✨ Finishing Touches
🧪 Generate Unit Tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🔭 Outside diff range comments (1)
pkg/clientconfig/configgen.go (1)
66-69: Let’s use the adjustedtraddrvalue returned bynvme.AdjustTraddr.The helper can transform the host string (e.g., strip leading zeros, normalize IPv6); discarding the returned value means we might feed an un-sanitized address into
net.JoinHostPortlater.- _, err = nvme.AdjustTraddr(host) - if err != nil { + host, err = nvme.AdjustTraddr(host) + if err != nil {
🧹 Nitpick comments (1)
pkg/clientconfig/configgen.go (1)
187-187: Great switch tonet.JoinHostPort; tiny follow-up tweak.Using
JoinHostPortis the right call for IPv6.
Since we already importstrconv, we can avoid spinning upfmthere for minor perf/alloc savings:- endpoint := net.JoinHostPort(traddr, fmt.Sprintf("%d", discoveryServicePort)) + endpoint := net.JoinHostPort(traddr, strconv.FormatUint(uint64(discoveryServicePort), 10))
Replaced to use join host port for support in ip v6.