Take the suffix of internal names from the Input and never the environment: Input.InternalSuffix and a local internal-name helper, so the package doc is true (review round 1, finding 5). The test failed first; the suite is 1257 tests in 1.04 s

This commit is contained in:
2026-10-20 07:02:58 +00:00
parent 892a3955b7
commit 3eadff23eb
4 changed files with 47 additions and 8 deletions
+7 -7
View File
@@ -120,7 +120,7 @@ func (c *composer) places(nodeName string, resolved Resolved) (Placed, error) {
// And who holds each replicated seat, where (novox/hq ADR 0223).
r.Holders = c.replicatedHolders()
r.Suffix, r.TunnelInterface = overlay.Suffix(), overlay.Interface
r.Suffix, r.TunnelInterface = c.suffix(), overlay.Interface
// And, for a module that keeps them, every operator-sealed secret in the mesh (novox/hq ADR 0085, amended).
for _, m := range plan.Modules {
@@ -272,16 +272,16 @@ func (c *composer) onThePrivateNetwork() []string {
func (c *composer) namesInTheMesh() map[string]string {
out := map[string]string{}
for _, p := range c.onTheNetwork() {
out[overlay.InternalName(p.Name)] = p.Place.Address
out[c.internalName(p.Name)] = p.Place.Address
}
for _, p := range c.in.CarriedPeers {
if p.Named == "" || p.EnrolledAs != "" {
continue
}
if _, taken := out[overlay.InternalName(p.Named)]; taken {
if _, taken := out[c.internalName(p.Named)]; taken {
continue // a node of the mesh owns the name; the stale statement loses
}
out[overlay.InternalName(p.Named)] = p.Address
out[c.internalName(p.Named)] = p.Address
}
return out
}
@@ -342,7 +342,7 @@ func (c *composer) artifactStoreAddress(forNode string) (string, error) {
return "", err
}
if found {
return overlay.InternalName(node) + ":" + port, nil
return c.internalName(node) + ":" + port, nil
}
all := map[string]bool{}
for _, n := range c.in.Nodes {
@@ -399,7 +399,7 @@ func (c *composer) zonesInTheMesh() ([]catalogue.ZoneAt, error) {
zones = append(zones, *z)
}
}
if problems := catalogue.ZonesProblems(zones, overlay.Suffix(), public); len(problems) > 0 {
if problems := catalogue.ZonesProblems(zones, c.suffix(), public); len(problems) > 0 {
return nil, fmt.Errorf("the mesh's zones cannot be forwarded:\n - %s", strings.Join(problems, "\n - "))
}
return zones, nil
@@ -458,7 +458,7 @@ func (c *composer) replicatedHolders() map[string]map[string]string {
at := map[string]string{}
for _, n := range nodes {
if address[n] != "" {
at[overlay.InternalName(n)] = address[n]
at[c.internalName(n)] = address[n]
}
}
out[seat.Name] = at