diff --git a/internal/catalogue/bus_snapshot_test.go b/internal/catalogue/bus_snapshot_test.go index e9904350..57384996 100644 --- a/internal/catalogue/bus_snapshot_test.go +++ b/internal/catalogue/bus_snapshot_test.go @@ -30,6 +30,15 @@ func TestTheBussAccountSaysNothingOnTheBus(t *testing.T) { if _, err := ParseManifest(bundled); err != nil { t.Fatalf("a bus module whose tools bundle declares what it emits was refused: %v", err) } + // And as built: the resolved manifest registration reads keeps the bundles its build made and drops the + // build, and must be registrable just the same. + built := []byte(`{"module":"bus","version":"1","provides":[{"name":"mesh-bus","scope":"mesh"}], + "claims":[{"name":"mesh-broker","scope":"mesh"}],"own-secrets":{"broker":"/run/broker"}, + "emits":["bus.slow-consumer"],"tools":["bus_streams"], + "bundles":[{"name":"tools","source":"bundles/bus/tools","digest":"sha256:00","language":"go"}]}`) + if _, err := ParseManifest(built); err != nil { + t.Fatalf("the built bus module, its bundle made, is not registrable: %v", err) + } quiet := []byte(`{"module":"bus","version":"1","provides":[{"name":"mesh-bus","scope":"mesh"}], "claims":[{"name":"mesh-broker","scope":"mesh"}],"own-secrets":{"broker":"/run/broker"}, diff --git a/internal/catalogue/manifest.go b/internal/catalogue/manifest.go index 21ec6363..a4ea5073 100644 --- a/internal/catalogue/manifest.go +++ b/internal/catalogue/manifest.go @@ -2903,8 +2903,13 @@ func whileStoppedProblems(m Manifest, r map[string]any, scheduled bool) []string return problems } -// shipsABundle says the module builds a tools bundle, which the node's runtime carries and speaks for. +// shipsABundle says the module builds a tools bundle, which the node's runtime carries and speaks for: as +// written, by its build's artifacts; as built and registered, by the bundles its build made — the resolved +// manifest keeps those and drops the build (the merge gate found nats not registrable on that, review 274). func (m Manifest) shipsABundle() bool { + if len(m.Bundles) > 0 { + return true + } if m.Build == nil { return false }