From 40f169229d110805a1a082a4a7693b6b4e0aec72 Mon Sep 17 00:00:00 2001 From: jochen Date: Thu, 1 Oct 2026 21:41:23 +0200 Subject: [PATCH] A converged machine says its strays too node show printed what a machine reports only for an adopted one; a converged machine holds nothing and can still run a container nobody asked for (hq ADR 0163), so its strays are said whatever its mode. --- cmd/mesh-controller/adoption.go | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/cmd/mesh-controller/adoption.go b/cmd/mesh-controller/adoption.go index e3e40dc..7e30353 100644 --- a/cmd/mesh-controller/adoption.go +++ b/cmd/mesh-controller/adoption.go @@ -24,6 +24,11 @@ import ( func showMode(ctx context.Context, inv *inventory.Inventory, node inventory.Node) error { if !node.Adopted { fmt.Printf(" mode converged\n") + // A converged machine holds nothing, and can still run what nobody asked for + // (novox/hq ADR 0163): what it reports as strays is said whatever its mode. + if said, err := inv.AdoptionOf(ctx, node.Name); err == nil && len(said.Strays) > 0 { + showStrays(said.Strays) + } return nil } fmt.Printf(" mode adopted since %s\n", @@ -66,16 +71,22 @@ func showMode(ctx context.Context, inv *inventory.Inventory, node inventory.Node fmt.Printf(" %-17s %s\n", "", f) } } - if len(said.Strays) > 0 { - fmt.Printf(" strays %d container(s) the mesh neither wrote nor holds:\n", len(said.Strays)) - for _, s := range said.Strays { - fmt.Printf(" %-17s %s (%s)\n", "", s.Name, s.Detail) - } - } + showStrays(said.Strays) fmt.Printf(" as of %s\n", said.At.Local().Format(time.DateTime)) return nil } +// showStrays says what a machine runs that the mesh neither wrote nor holds (ADR 0163). +func showStrays(strays []inventory.Stray) { + if len(strays) == 0 { + return + } + fmt.Printf(" strays %d container(s) the mesh neither wrote nor holds:\n", len(strays)) + for _, s := range strays { + fmt.Printf(" %-17s %s (%s)\n", "", s.Name, s.Detail) + } +} + // showTunnel is the node show lines about the tunnel an adopted node found and carried (novox/hq // ADR 0105): what it presented at enrolment, and what it last said about taking it over. func showTunnel(ctx context.Context, inv *inventory.Inventory, name string) error { -- 2.54.0