Skip to content

Commit

Permalink
fix: build siderolink endpoint correctly
Browse files Browse the repository at this point in the history
This was breaking for IPv6 addresses.

Closes #1116

(This is a better/shorter fix).

Signed-off-by: Andrey Smirnov <[email protected]>
  • Loading branch information
smira committed May 3, 2023
1 parent 049a5fa commit 45ac3d8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/sidero-controller-manager/cmd/siderolink-manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"net/netip"
"os"
"os/signal"
"strconv"
"syscall"

grpc_zap "github.com/grpc-ecosystem/go-grpc-middleware/logging/zap"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 45ac3d8

Please sign in to comment.