-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[management] move network map logic into new design #4774
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
pascal-fischer
merged 25 commits into
main
from
refactor/network-map-controller-new-design
Nov 13, 2025
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
03b599a
move network map logic into new design
pascal-fischer 1d25cf8
fix tests
pascal-fischer 092fc24
go mod tidy
pascal-fischer da1ffe4
fix client tests
pascal-fischer febde70
fix linter
pascal-fischer ee45532
fix user delete test
pascal-fischer 51ad8d7
drain channel before delete peer test
pascal-fischer e6aa119
remove leftover timer
pascal-fischer d35f904
fix peers handler
pascal-fischer 71684e4
fix some of the rabbit remarks
pascal-fischer addb4df
delete testdata result
pascal-fischer bfc84c0
remove proxy code
pascal-fischer abb8782
fix imports
pascal-fischer 04209c5
remove proxy container
pascal-fischer 41744aa
Revert "remove proxy container"
pascal-fischer 1908cfa
Revert "fix imports"
pascal-fischer 705fd84
Revert "remove proxy code"
pascal-fischer f2bb181
bring back proxy map merge
pascal-fischer 83b8216
fix test constructor
pascal-fischer 0294c04
fix client side
pascal-fischer a31e293
remove channel drain for non experimental
pascal-fischer a0b7a8f
fix flaky test
pascal-fischer 46f0e6c
do not double recalculate on partial update
pascal-fischer 596820b
send update
pascal-fischer 40808a0
expect network map on all peer updates
pascal-fischer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
management/internals/controllers/network_map/controller/cache/dns_config_cache.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| package cache | ||
|
|
||
| import ( | ||
| "sync" | ||
|
|
||
| "github.com/netbirdio/netbird/shared/management/proto" | ||
| ) | ||
|
|
||
| // DNSConfigCache is a thread-safe cache for DNS configuration components | ||
| type DNSConfigCache struct { | ||
| NameServerGroups sync.Map | ||
| } | ||
|
|
||
| // GetNameServerGroup retrieves a cached name server group | ||
| func (c *DNSConfigCache) GetNameServerGroup(key string) (*proto.NameServerGroup, bool) { | ||
| if c == nil { | ||
| return nil, false | ||
| } | ||
| if value, ok := c.NameServerGroups.Load(key); ok { | ||
| return value.(*proto.NameServerGroup), true | ||
| } | ||
| return nil, false | ||
| } | ||
|
|
||
| // SetNameServerGroup stores a name server group in the cache | ||
| func (c *DNSConfigCache) SetNameServerGroup(key string, value *proto.NameServerGroup) { | ||
| if c == nil { | ||
| return | ||
| } | ||
| c.NameServerGroups.Store(key, value) | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
Verify
go.uber.org/mockv0.5.0 is current and appropriate for the refactoring.Promoting
go.uber.org/mockto a direct dependency aligns with the PR's new controller-based mocking infrastructure. However, ensure this version is maintained, compatible with your test suite, and free from known issues.🌐 Web query:
💡 Result:
Short answer: No — v0.5.0 is not the most recent release. There have been patch releases (e.g. v0.5.2 on 2025‑04‑28) and further activity; the project is actively maintained and supports the two most recent Go releases. [1][2][5]
Security/compatibility summary:
Recommendations:
go list -m -versions go.uber.org/mockor check the repo releases and then update your go.mod to that version.Sources:
[1] uber-go/mock (GitHub repo).
[2] Release notes / v0.5.2 (published 2025‑04‑28).
[3] Snyk package advisory for github.com/uber-go/mock (no direct vulnerabilities).
[4] uber-go/mock GitHub issues (open compatibility/bug reports).
[5] pkg.go.dev entry for go.uber.org/mock (module details, supported Go versions).
Update
go.uber.org/mockto v0.5.2 or the latest stable version.v0.5.0 is not the current stable version; newer releases (e.g., v0.5.2 released 2025‑04‑28) are available. Recent patch releases address functional bugs and compatibility issues with Go generics and type aliases. Given this PR's major refactoring with new mocking infrastructure, update to the latest patch release to ensure compatibility and avoid known issues.
🤖 Prompt for AI Agents