From a0459a85531129903e959b35f2ab89d43d9a941c Mon Sep 17 00:00:00 2001 From: jochen Date: Mon, 9 Nov 2026 01:42:40 +0100 Subject: [PATCH] distribution's manifest test reads the listens with its own struct and checks every mapping's sides for 5100 Claude-Session: https://claude.ai/code/session_01NcbgfFSnn24M3GcqttoU7i --- .../distribution/internal/holder/holder_test.go | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/modules/distribution/internal/holder/holder_test.go b/modules/distribution/internal/holder/holder_test.go index eb7026021..d3cbe2bac 100644 --- a/modules/distribution/internal/holder/holder_test.go +++ b/modules/distribution/internal/holder/holder_test.go @@ -835,6 +835,10 @@ func TestTheHolderOfTheTwoImageSeats(t *testing.T) { Resources []map[string]any `json:"resources"` Consumes []string `json:"consumes"` Packages map[string]string `json:"packages"` + Listens []struct { + Name string `json:"name"` + Port int `json:"port"` + } `json:"listens"` } if err := json.Unmarshal(raw, &m); err != nil { t.Fatal(err) @@ -893,8 +897,15 @@ func TestTheHolderOfTheTwoImageSeats(t *testing.T) { if len(m.Listens) != 1 || m.Listens[0].Port != 5100 { t.Fatalf("listens = %+v, want registry on 5100, where every machine fetches", m.Listens) } - if at, mayAssign := m.MachineSide(5100); at != 5100 || mayAssign { - t.Errorf("the machine side of 5100 = %d (may assign %v), want 5100 bound by the program, named by no container", at, mayAssign) + for _, r := range m.Resources { + ports, _ := r["ports"].([]any) + for _, p := range ports { + for _, side := range strings.Split(fmt.Sprint(p), ":") { + if side == "5100" { + t.Errorf("%v maps %v: want 5100 bound by the program, named by no container", r["id"], p) + } + } + } } // Running review F2: incoming asks the bus 8 GiB, the most the objects template allows, equal to IncomingCap // (said only where no binding is read); transfers keeps for good, the holder dropping an idle one by its key