[PR #7048] [CLOSED] [management] add agent network ServingProxyAddress #30118

Closed
opened 2026-08-05 08:10:12 -04:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/7048
Author: @bison
Created: 8/3/2026
Status: Closed

Base: feat/agent-network-zoneHead: feat/agent-network-serving-proxy


📝 Commits (2)

  • 7f3a29d feat(agentnetwork): record which proxy serves an account
  • 7020917 chore(agentnetwork): state why TargetId stays pinned to the shared cluster

📊 Changes

8 files changed (+184 additions, -6 deletions)

View changed files

📝 management/internals/modules/agentnetwork/synthesizer.go (+7 -1)
📝 management/internals/modules/agentnetwork/synthesizer_test.go (+97 -0)
📝 management/internals/modules/agentnetwork/types/settings.go (+30 -3)
📝 management/internals/modules/agentnetwork/types/settings_test.go (+14 -0)
📝 management/server/store/sql_store_agentnetwork.go (+18 -0)
📝 management/server/store/store.go (+1 -0)
📝 management/server/store/store_mock.go (+14 -0)
📝 management/server/types/account.go (+3 -2)

📄 Description

Describe your changes

What

Records which proxy serves an account, so an account can be moved onto a different proxy without its hostname changing.

Adds ServingProxyAddress to the agent-network settings row. Empty — the value for every existing row — means the shared proxy named by Cluster serves the account, which is current behaviour exactly. When set, the account's synthesized service advertises that address as its proxy instead.

That one value is what redirects the account: mesh-DNS peer selection and mapping delivery both already join on the service's advertised proxy address, so neither join changes.

Why it is mutable

Cluster, Subdomain and Zone are fixed once written. This column is deliberately the exception — moving an account onto a dedicated proxy, and moving it back, is exactly one write here.

Who writes it

Nothing in this repository. It is set by an operator, or by an external control plane that assigns dedicated proxies. The included store setter updates that single column rather than saving the whole row, so an assignment cannot clobber a concurrent settings change.

Stack

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)
  • I ran and tested this change locally — I did not rely on CI to find out whether it works
  • This PR has a single purpose (not a fix + refactor + feature in one)
  • This change is a trivial fix, OR it links an issue the NetBird team agreed on beforehand. Changes to the public API, gRPC protocols, functionality behavior, CLI / service flags, or new features always need that agreement first. See CONTRIBUTING.md.

By submitting this pull request, you confirm that you have read and agree to the terms of the Contributor License Agreement.

Documentation

Select exactly one:

  • I added/updated documentation for this change
  • Documentation is not needed for this change (explain why)

Docs PR URL (required if "docs added" is checked)

N/A


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbirdio/netbird/pull/7048 **Author:** [@bison](https://github.com/bison) **Created:** 8/3/2026 **Status:** ❌ Closed **Base:** `feat/agent-network-zone` ← **Head:** `feat/agent-network-serving-proxy` --- ### 📝 Commits (2) - [`7f3a29d`](https://github.com/netbirdio/netbird/commit/7f3a29d6888c60000de110f4ec4e2cfce9bd6ec5) feat(agentnetwork): record which proxy serves an account - [`7020917`](https://github.com/netbirdio/netbird/commit/70209170259fd95bc0517b00dc2be0933f11f7a4) chore(agentnetwork): state why TargetId stays pinned to the shared cluster ### 📊 Changes **8 files changed** (+184 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `management/internals/modules/agentnetwork/synthesizer.go` (+7 -1) 📝 `management/internals/modules/agentnetwork/synthesizer_test.go` (+97 -0) 📝 `management/internals/modules/agentnetwork/types/settings.go` (+30 -3) 📝 `management/internals/modules/agentnetwork/types/settings_test.go` (+14 -0) 📝 `management/server/store/sql_store_agentnetwork.go` (+18 -0) 📝 `management/server/store/store.go` (+1 -0) 📝 `management/server/store/store_mock.go` (+14 -0) 📝 `management/server/types/account.go` (+3 -2) </details> ### 📄 Description ## Describe your changes ### What Records which proxy serves an account, so an account can be moved onto a different proxy without its hostname changing. Adds ServingProxyAddress to the agent-network settings row. Empty — the value for every existing row — means the shared proxy named by Cluster serves the account, which is current behaviour exactly. When set, the account's synthesized service advertises that address as its proxy instead. That one value is what redirects the account: mesh-DNS peer selection and mapping delivery both already join on the service's advertised proxy address, so neither join changes. ### Why it is mutable Cluster, Subdomain and Zone are fixed once written. This column is deliberately the exception — moving an account onto a dedicated proxy, and moving it back, is exactly one write here. ### Who writes it Nothing in this repository. It is set by an operator, or by an external control plane that assigns dedicated proxies. The included store setter updates that single column rather than saving the whole row, so an assignment cannot clobber a concurrent settings change. ## Issue ticket number and link <!-- Required for anything that changes behavior. Link the issue (or the validated discussion it came from) that the NetBird team already agreed on. See https://github.com/netbirdio/netbird/blob/main/CONTRIBUTING.md#ticket-first-pr-second --> ## Stack <!-- branch-stack --> ### Checklist - [ ] Is it a bug fix - [ ] Is a typo/documentation fix - [ ] Is a feature enhancement - [x] It is a refactor - [ ] Created tests that fail without the change (if possible) - [ ] I ran and tested this change locally — I did not rely on CI to find out whether it works - [ ] This PR has a single purpose (not a fix + refactor + feature in one) - [ ] This change is a trivial fix, **OR** it links an issue the NetBird team agreed on beforehand. Changes to the public API, gRPC protocols, functionality behavior, CLI / service flags, or new features always need that agreement first. See [CONTRIBUTING.md](https://github.com/netbirdio/netbird/blob/main/CONTRIBUTING.md#ticket-first-pr-second). > By submitting this pull request, you confirm that you have read and agree to the terms of the [Contributor License Agreement](https://github.com/netbirdio/netbird/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT.md). ## Documentation Select exactly one: - [ ] I added/updated documentation for this change - [x] Documentation is **not needed** for this change (explain why) ### Docs PR URL (required if "docs added" is checked) N/A --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
saavagebueno added the pull-request label 2026-08-05 08:10:12 -04:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#30118