diff --git a/app/sidero-controller-manager/cmd/siderolink-manager/main.go b/app/sidero-controller-manager/cmd/siderolink-manager/main.go index 1b7ea058..6ef76c4c 100644 --- a/app/sidero-controller-manager/cmd/siderolink-manager/main.go +++ b/app/sidero-controller-manager/cmd/siderolink-manager/main.go @@ -14,6 +14,7 @@ import ( "net/netip" "os" "os/signal" + "strconv" "syscall" grpc_zap "github.com/grpc-ecosystem/go-grpc-middleware/logging/zap" @@ -104,7 +105,7 @@ func run() error { logger.Sugar().Infof("resolved wireguard endpoint %s to %s", wireguardEndpoint, wireguardEndpointIP) } - siderolink.Cfg.WireguardEndpoint = fmt.Sprintf("%s:%d", wireguardEndpointIP, wireguardPort) + siderolink.Cfg.WireguardEndpoint = net.JoinHostPort(wireguardEndpointIP, strconv.Itoa(wireguardPort)) if err = siderolink.Cfg.LoadOrCreate(ctx, metalclient); err != nil { return err