The mesh assigns the port, and a module says it once
novox/hq ADR 0038. A module cannot choose a port: it is written once and assigned anywhere, so any number it picks is a guess about a machine it has never seen. A database module met the mesh's own store on 5432 and was told, by a container runtime three layers down, that the port was already allocated. The number used to appear three times in every module — the rule set, what a consumer is told, and what the runtime publishes — agreeing only because one person wrote all three. Now it appears once, in `listens`, and the other two are derived: the container publishes `20000:5432`, the consumer is told 20000, and the rule set opens 20000. An assignment is made once and kept, as a credential is. A port that moved on every declaration would restart both ends each time and hand a consumer a number that was true when it was read. Ports the protocol fixes — mail on 25, submission on 587, DNS on 53 — say so, and are then claims: one holder per machine, and the second is refused by name at assignment. That is the mechanism the mesh already has for what is singular on a machine, pointed at ports. A mapping written the long way is left exactly as it is. Some things must be pinned by hand, and quietly overruling somebody who wrote both halves would be worse than not offering the short form. Still open, and known: the substrate is not a module, so the mesh has never heard of its own store and cannot yet assign around it. That is what 028 will still be about after this.
This commit is contained in:
@@ -429,10 +429,13 @@ func declareOnItsOwn(t *testing.T, shelf map[string]catalogue.Manifest,
|
||||
// providing example says it serves.
|
||||
offered := map[string][]catalogue.Provider{}
|
||||
for _, want := range m.Requires {
|
||||
// Built the way the control plane builds it: what a provider tells a consumer includes
|
||||
// the port, and the module no longer writes that into `serves` by hand — it says it once
|
||||
// in `listens` and the mesh puts it there (novox/hq ADR 0038).
|
||||
serves := map[string]any{}
|
||||
for _, other := range shelf {
|
||||
if s, said := other.Serves[want]; said {
|
||||
serves = s
|
||||
if _, said := other.Serves[want]; said {
|
||||
serves = catalogue.ServedOn(other, want, nil)
|
||||
}
|
||||
}
|
||||
offered[want] = []catalogue.Provider{
|
||||
|
||||
Reference in New Issue
Block a user