From fee24d2b84dfefc22c99d2e2bf089859bc5f4e6f Mon Sep 17 00:00:00 2001 From: Pavel Borzenkov Date: Fri, 13 Feb 2026 16:55:19 +0100 Subject: [PATCH] deploy: don't check for private IPs during dns check Machines API returns both public and private (Flycast) allocated addresses. Filter out the private ones from the check as our public DNS will never return them. --- .../command/deploy/machines_deploymachinesapp.go | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/internal/command/deploy/machines_deploymachinesapp.go b/internal/command/deploy/machines_deploymachinesapp.go index fbf1d3d53e..a32679f594 100644 --- a/internal/command/deploy/machines_deploymachinesapp.go +++ b/internal/command/deploy/machines_deploymachinesapp.go @@ -8,6 +8,7 @@ import ( "maps" "math" "net" + "net/netip" "slices" "strconv" "strings" @@ -1382,9 +1383,18 @@ func (md *machineDeployment) checkDNS(ctx context.Context) error { var numIPv4, numIPv6 int for _, ipAddr := range ipAddrs { - if strings.Contains(ipAddr.IP, ".") && (ipAddr.Region == "global" || ipAddr.Shared) { + ip, err := netip.ParseAddr(ipAddr.IP) + if err != nil { + terminal.Debugf("failed to parse IP: %v", err) + continue + } + if ip.IsPrivate() { + continue + } + + if ip.Is4() && (ipAddr.Region == "global" || ipAddr.Shared) { numIPv4 += 1 - } else if strings.Contains(ipAddr.IP, ":") && ipAddr.Region == "global" { + } else if ip.Is6() && ipAddr.Region == "global" { numIPv6 += 1 } }