ENG-3, ENG-4: the node-engine keeps no seat table of its own (mesh-contracts' list through mesh-sdk), answers ${seat:...:reach} for both names of the store, and reads both reference forms in composition, image seat and bootstrap (ADR 0605 §9, design 26, issue 1966)
Claude-Session: https://claude.ai/code/session_01JG73KJNrH5EgFXMKKYSrig
This commit is contained in:
@@ -64,6 +64,22 @@ func TestAnImageTheMeshBuiltIsRoutedThroughTheStoreWhenDeclared(t *testing.T) {
|
||||
t.Errorf("%s names a seat: %v", id, got)
|
||||
}
|
||||
}
|
||||
// A reference in the form a registry seat answers is routed the same way, names the seat it came through (ENG-4), and its
|
||||
// bundle is fetched as an archive from the store.
|
||||
seatForm := mcat.Resolution{Node: "anchor", Modules: []mcat.Manifest{{Module: "gitea", Version: "1", Resources: []map[string]any{
|
||||
{"id": "server", "type": "container", "name": "mesh-gitea", "image": "container-image-registry/gitea/server@" + digest},
|
||||
{"id": "config", "type": "archive", "path": "/etc/gitea", "source": "oci-artifact-registry/gitea/config@" + digest}}}}}
|
||||
held.SeatHolder["container-image-registry"] = "distribution"
|
||||
seated, err := Declaration(seatForm, held)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if got := fileNamed(seated, "gitea.server"); got["image"] != "anchor.internal:5101/gitea/server@"+digest || got["image-seat"] != "container-image-registry" || got["image-holder"] != "distribution" {
|
||||
t.Errorf("a seat-form image is %v, naming %v %v", got["image"], got["image-seat"], got["image-holder"])
|
||||
}
|
||||
if got := fileNamed(seated, "gitea.config")["source"]; got != "http://anchor.internal:5101/v2/gitea/config/blobs/"+digest {
|
||||
t.Errorf("a seat-form archive is fetched from %v", got)
|
||||
}
|
||||
held.SeatHolder = map[string]string{"mesh-artifact-store": "other-holder"}
|
||||
if held2, err := Declaration(r, held); err != nil || fileNamed(held2, "gitea.server")["image-holder"] != "other-holder" {
|
||||
t.Errorf("a new holder is not written: %v", err)
|
||||
|
||||
Reference in New Issue
Block a user