1 Commits
Author SHA1 Message Date
jochen 119b616eff Genesis assigns mesh-wireguard, not the retired networking bundle (hq ADR 0226)
A controller that no longer ships networking refuses it, which would stop genesis where the hub
joins the private network.
2026-10-06 02:21:16 +02:00
2 changed files with 37 additions and 3 deletions
+33
View File
@@ -0,0 +1,33 @@
package bootstrap
import (
"context"
"strconv"
"strings"
"testing"
"time"
)
// Genesis assigns the private network by its own module's name (novox/hq ADR 0226). The
// `networking` bundle that only required it is retired, and a controller that no longer ships it
// refuses an assignment of it — which would stop genesis at the step that puts the hub on the
// network.
func TestGenesisAssignsThePrivateNetworkByItsOwnName(t *testing.T) {
rec := &controlRecorder{settings: map[string]string{}}
control := controlPlane{container: "mesh-controller", run: rec.run, timeout: time.Second}
o := Options{Node: "anchor", Site: "home", Wait: time.Second, Answers: map[string]string{
"private-network": "wireguard",
"endpoint": "203.0.113.10:" + strconv.Itoa(DefaultPorts().Hub),
}}
if err := PlaceOnTheNetwork(context.Background(), o, control, "203.0.113.10:4222", quietly); err != nil {
t.Fatal(err)
}
if rec.index("assign anchor mesh-wireguard") < 0 || rec.index("overlay place anchor") < 0 {
t.Fatalf("genesis did not assign mesh-wireguard: %v", rec.told)
}
for _, said := range rec.told {
if strings.HasPrefix(said, "assign") && strings.HasSuffix(said, " networking") {
t.Fatalf("genesis assigned the retired bundle: %v", rec.told)
}
}
}
+4 -3
View File
@@ -116,9 +116,10 @@ func PlaceOnTheNetwork(ctx context.Context, o Options, control controlPlane,
if err != nil {
return err
}
// Today the one provider is the control plane's own computed module. The choice exists so
// that the day there are two, this asks instead of assuming.
module := "networking"
// Today the one provider is the control plane's own computed module, assigned by its own name:
// the `networking` bundle that only required it is retired (novox/hq ADR 0226). The choice
// exists so that the day there are two, this asks instead of assuming.
module := "mesh-wireguard"
_ = network
endpoint, err := decide(Choice{