mirror of
https://github.com/netbirdio/netbird.git
synced 2026-10-14 01:19:09 +02:00
[management] Decide gateway cluster ownership before the account's own view
The ownership check only ran when the account's own view of the cluster came back empty, so an account holding any row for the host — its own canonical proxy — skipped it entirely. A row another account left behind under a non-canonical spelling was then never seen, and the pin the check exists to refuse went through. That is the case worth catching, not the one to skip: two accounts claiming one hostname is the ambiguity the connect-time conflict check prevents going forward and cannot see for a row written before addresses were canonicalized, and the endpoint pinned here cannot be moved afterwards. Ask ownership first, and narrow what counts as foreign while doing it. The query treated a shared proxy as outside the account, which was harmless while it ran only for a host the account had no view of — a shared row would have given it one — but refuses the cluster most accounts pin to once it runs first. Only a row owned by a different account is foreign now, which is also what the name says.
This commit is contained in:
@@ -340,7 +340,7 @@ type Store interface {
|
||||
CountProxiesByAccountID(ctx context.Context, accountID string) (int64, error)
|
||||
IsClusterAddressConflicting(ctx context.Context, clusterAddress, accountID string) (bool, error)
|
||||
HasActiveProxyAtClusterAddress(ctx context.Context, clusterAddress string) (bool, error)
|
||||
HasProxyOutsideAccountAtHost(ctx context.Context, host, accountID string) (bool, error)
|
||||
HasForeignAccountProxyAtHost(ctx context.Context, host, accountID string) (bool, error)
|
||||
DeleteAccountCluster(ctx context.Context, clusterAddress, accountID string) error
|
||||
|
||||
GetCustomDomainsCounts(ctx context.Context) (total int64, validated int64, err error)
|
||||
|
||||
Reference in New Issue
Block a user