bootstrap: the temporary control plane gets a temporary name
The substrate raises a control plane and a module will later declare one. If both are called `mesh-control` then for one moment two owners hold one container, and the host — which tracks what it owns — has no way to stop owning something without destroying it. That looked like a missing mechanism. It is a naming problem. The substrate's container becomes `temp-mesh-control` and the module's keeps the plain name: two containers, two owners, nothing to hand over. Dropping the temporary one from the bundle at the end is then destruction by omission, which is what the host already does to anything that leaves a declaration — and the right end for something named "temp" (novox/hq ADR 0067). The rename is textual and matches the QUOTED name, so the `mesh-control` inside the image reference is not caught by it. Read back afterwards: the produced bundle must call it the temporary name, and no other container may have been renamed. Claude-Session: https://claude.ai/code/session_01LrgweAeERJYBg88c5cKDzF
This commit is contained in:
@@ -85,9 +85,11 @@ func TestASubstrateThatIsUpAndAnsweringIsAccepted(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
// Three long-running containers: the store, the broker and the control plane. The run-once and
|
||||
// scheduled shapes are excluded on purpose — a step that has exited is not a fault.
|
||||
want := []string{"mesh-store", "mesh-broker", "mesh-control"}
|
||||
// Three long-running containers: the store, the broker and the TEMPORARY control plane. The
|
||||
// run-once and scheduled shapes are excluded on purpose — a step that has exited is not a
|
||||
// fault. The name is `temp-mesh-control` because the permanent one is a module and takes the
|
||||
// plain name (novox/hq ADR 0067), which is what makes the two of them coexist at all.
|
||||
want := []string{"mesh-store", "mesh-broker", "temp-mesh-control"}
|
||||
if len(verified.Running) != len(want) {
|
||||
t.Fatalf("confirmed %v running, want %v", verified.Running, want)
|
||||
}
|
||||
@@ -162,7 +164,7 @@ func TestTheControlPlaneIsAskedByRunningItsOwnBinary(t *testing.T) {
|
||||
time.Second, 0, func(string) {}); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if !runtime.ran("docker exec mesh-control " + controlPlaneBinary + " status") {
|
||||
if !runtime.ran("docker exec " + TempPrefix + "mesh-control " + controlPlaneBinary + " status") {
|
||||
t.Errorf("the control plane was never asked anything: %v", runtime.commands)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user