From 8c0bb9d4531d45121b7d0dd37bdbc4441c8d4f40 Mon Sep 17 00:00:00 2001 From: jochen Date: Thu, 22 Oct 2026 21:46:34 +0200 Subject: [PATCH] Read the bus's release from the nats module's pinned server image, not a NATS_BASE build argument (issue 1875) The nats module takes its server as an upstream artifact, pinned by digest (issue 1641), and builds no image on a NATS_BASE argument any more. The test of the bundle's bus read that argument, found none, and failed every mesh-host check against the catalogue's main. Bootstrap's own code never read it: the bundle's bus image comes from the bundle, so genesis was not affected. The test now compares the bundle's image with the module's server by repository and digest. --- internal/bootstrap/bus_adoption_test.go | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/internal/bootstrap/bus_adoption_test.go b/internal/bootstrap/bus_adoption_test.go index cbb52e9..1c16bf1 100644 --- a/internal/bootstrap/bus_adoption_test.go +++ b/internal/bootstrap/bus_adoption_test.go @@ -108,28 +108,35 @@ func TestABusStepThatEndsFailedIsRefused(t *testing.T) { } } -// The bundle's bus runs the release the module's image is built on, pinned by the same digest, so the -// adoption changes no server release and is reversible as the step says (ADR 0333 §3). +// The bundle's bus runs the release the module's server is, pinned by the same digest, so the adoption changes no +// server release and is reversible as the step says (ADR 0333 §3). The module takes the server as an upstream +// artifact, its image reference pinned by digest (issue 1641); it no longer builds an image on a NATS_BASE argument, +// which this test read until issue 1875. func TestTheBundlesBusRunsTheReleaseTheModulesImageIsBuiltOn(t *testing.T) { var m struct { Build struct { - On []struct{ Arg, Image string } `json:"on"` + Artifacts []struct{ Name, Kind, From string } `json:"artifacts"` } `json:"build"` } if err := json.Unmarshal(theCataloguesModule(t, BusModule), &m); err != nil { t.Fatal(err) } - base := "" - for _, on := range m.Build.On { - if on.Arg == "NATS_BASE" { - base = on.Image + from := "" + for _, a := range m.Build.Artifacts { + if a.Name == "server" && a.Kind == "upstream" { + from = a.From } } + name, digest, pinned := strings.Cut(from, "@") + if !pinned || !strings.HasPrefix(digest, "sha256:") { + t.Fatalf("the nats module's server is no upstream image pinned by digest: %q", from) + } + repository, _, _ := strings.Cut(name, ":") rewritten, err := Rewrite(theRealBundle(t), held) if err != nil { t.Fatal(err) } - if got := containerNamed(rewritten.Declaration, "mesh-broker-nats").Image; got != base { - t.Errorf("the bundle raises the bus on %s; the nats module's image is built on %s", got, base) + if got, want := containerNamed(rewritten.Declaration, "mesh-broker-nats").Image, repository+"@"+digest; got != want { + t.Errorf("the bundle raises the bus on %s; the nats module's server is %s (%s)", got, want, from) } }