From 4b209d944dd7ff892db7e1503113dbbb8fc31f9e Mon Sep 17 00:00:00 2001 From: jochen Date: Mon, 28 Sep 2026 00:34:17 +0200 Subject: [PATCH] The mint finds the bus on the hub MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The map of who is where on the private network lists the machines placed around the hub, not the hub — and the control node is the hub, and runs the new bus. Found on the first live run: refused for having no address. The address every machine already dials the current bus at is the same machine, so that host with the new port is what they are told. --- cmd/mesh-controller/rollout.go | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/cmd/mesh-controller/rollout.go b/cmd/mesh-controller/rollout.go index e31ac01..6e4e8e1 100644 --- a/cmd/mesh-controller/rollout.go +++ b/cmd/mesh-controller/rollout.go @@ -243,11 +243,24 @@ func rolloutMint(ctx context.Context) error { if err != nil { return err } - if onNetwork[busNode] == "" { - return fmt.Errorf("%s runs the new bus and has no address on the private network, so no machine "+ - "could be told where it is", busNode) + busHost := onNetwork[busNode] + if busHost == "" { + // **The hub is not in that map.** The machine that took over the tunnel is where the current + // bus already answers, and every machine dials it at the address the mesh handed them — so + // when the new bus runs on the same machine, that address is the one to tell them, with the + // new port. Found live: the control node is the hub, and the map lists the machines placed + // around it. + host := strings.TrimSpace(broker.BareAddress(known.Address)) + if i := strings.LastIndex(host, ":"); i > 0 && !strings.Contains(host[i:], "]") { + host = host[:i] + } + if host == "" { + return fmt.Errorf("%s runs the new bus and has no address on the private network, and the "+ + "current bus's address is unknown too, so no machine could be told where it is", busNode) + } + busHost = host } - busAddress := onNetwork[busNode] + ":4222" + busAddress := busHost + ":4222" records, err := inv.BusRecords(ctx) if err != nil { -- 2.54.0