feat(agentnetwork): thread the zone config through to the manager

Adds AgentNetwork.Zone to the management config and passes it to the
agent-network manager, alongside the existing plumbing in the combined
binary. Nothing reads it yet -- the allocator that stamps it onto new rows
comes next -- so this commit is inert on its own.
This commit is contained in:
Brad Ison
2026-08-03 23:36:06 +02:00
parent fabfacee55
commit 6203528f3a
9 changed files with 23 additions and 7 deletions
@@ -61,7 +61,7 @@ func newAgentNetworkHandlerFixture(t *testing.T) *agentNetworkHandlerFixture {
Return(true, context.Background(), nil).
AnyTimes()
manager := agentnetwork.NewManager(st, perms, nil, nil)
manager := agentnetwork.NewManager(st, perms, nil, nil, "")
h := &handler{manager: manager}
router := mux.NewRouter()
@@ -122,6 +122,10 @@ type managerImpl struct {
permissionsManager permissions.Manager
proxyController proxy.Controller
// zone is the parent DNS zone stamped onto newly allocated settings rows.
// Empty keeps the legacy <subdomain>.<cluster> endpoint form.
zone string
// reconcileCache holds the last set of synthesised proxy mappings
// per account so reconcile can emit precise Create/Update/Delete
// updates instead of a full re-push on every mutation. Keyed by
@@ -145,12 +149,14 @@ func NewManager(
permissionsManager permissions.Manager,
accountManager account.Manager,
proxyController proxy.Controller,
zone string,
) Manager {
return &managerImpl{
store: store,
accountManager: accountManager,
permissionsManager: permissionsManager,
proxyController: proxyController,
zone: zone,
reconcileCache: make(map[string]map[string]*proto.ProxyMapping),
labelRng: rand.New(rand.NewSource(time.Now().UnixNano())),
}
@@ -48,7 +48,7 @@ func newBootstrapFixture(t *testing.T) *bootstrapFixture {
accounts.EXPECT().BufferUpdateAccountPeers(gomock.Any(), gomock.Any(), gomock.Any()).AnyTimes()
return &bootstrapFixture{
manager: NewManager(st, perms, accounts, nil),
manager: NewManager(st, perms, accounts, nil, ""),
store: st,
perms: perms,
}