Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/replicatedhq/troubleshoot

go 1.24.6
go 1.25.4

require (
github.com/Masterminds/sprig/v3 v3.3.0
Expand Down
5 changes: 3 additions & 2 deletions pkg/namespaces/namespace-pinger.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package namespaces
import (
"fmt"
"net"
"strconv"
"time"
)

Expand Down Expand Up @@ -51,7 +52,7 @@ func (n *NamespacePinger) PingUDP(dst net.IP) error {
func (n *NamespacePinger) PingTCP(dst net.IP) error {
n.cfg.Logf("reaching to %q from %q with tcp", dst, n.InternalIP)
pinger := func() error {
addr := fmt.Sprintf("%s:%d", dst, n.cfg.Port)
addr := net.JoinHostPort(dst.String(), strconv.Itoa(n.cfg.Port))
conn, err := net.DialTimeout("tcp", addr, n.cfg.Timeout)
if err != nil {
return fmt.Errorf("error dialing tcp: %w", err)
Expand Down Expand Up @@ -90,7 +91,7 @@ func (n *NamespacePinger) StartTCPEchoServer(errors chan error) {
// received, the server ends. Callers must wait until the ready channel is
// closed before they can start sending packets.
func (n *NamespacePinger) startTCPEchoServer(ready chan struct{}) (err error) {
addr := fmt.Sprintf("%s:%d", n.InternalIP, n.cfg.Port)
addr := net.JoinHostPort(n.InternalIP.String(), strconv.Itoa(n.cfg.Port))
n.cfg.Logf("starting tcp echo server on namespace %q(%q)", n.name, addr)

if err = n.Join(); err != nil {
Expand Down
Loading