package catalogue // The control plane's own addresses follow the node's ports (novox/hq 04-ISSUES/102). // SeatPorts is what the control plane's manifest says beside each sealed connection: the port // this machine put the seat's holder at (novox/hq 04-ISSUES/102). var SeatPorts = map[string]string{ "MESH_STORE_INVENTORY_PORT": "${seat:mesh-store:5432}", "MESH_STORE_IDENTITY_PORT": "${seat:mesh-store:5432}", "MESH_STORE_LICENCES_PORT": "${seat:mesh-store:5432}", "MESH_BROKER_MANAGEMENT_PORT": "${seat:mesh-broker:15672}", "MESH_BROKER_ADDRESS_PORT": "${seat:mesh-broker:5671}", } // withSeatPorts is the control plane's manifest with SeatPorts in its container's environment. // // **The manifest lands one commit after the code that fills it**, deliberately: a control plane // still running the previous build passes `${seat:…}` through unfilled, and the manifest may only // name the placeholder once every control plane that could compose it knows it. So the test does // not depend on module.json carrying these yet, and is a no-op once it does. func withSeatPorts(m Manifest) Manifest { out := m out.Resources = nil for _, r := range m.Resources { if r["type"] != "container" && r["type"] != "process" { out.Resources = append(out.Resources, r) continue } copied := map[string]any{} for k, v := range r { copied[k] = v } env := map[string]any{} if had, ok := r["env"].(map[string]any); ok { for k, v := range had { env[k] = v } } for k, v := range SeatPorts { if _, said := env[k]; !said { env[k] = v } } copied["env"] = env out.Resources = append(out.Resources, copied) } return out } // Where this machine reaches a mesh seat's holder (novox/hq ADR 0222, issue 190): the container // runtime's module tells the runtime to trust the mesh's registry without binding the store.