mirror of
https://github.com/netbirdio/netbird.git
synced 2026-04-05 09:04:09 -04:00
Move dns label generation to store (#552)
This commit is contained in:
@@ -384,12 +384,6 @@ func BuildManager(store Store, peersUpdateManager *PeersUpdateManager, idpManage
|
||||
shouldSave = true
|
||||
}
|
||||
|
||||
existingLabels := account.getPeerDNSLabels()
|
||||
if len(existingLabels) != len(account.Peers) {
|
||||
addPeerLabelsToAccount(account, existingLabels)
|
||||
shouldSave = true
|
||||
}
|
||||
|
||||
if shouldSave {
|
||||
err = store.SaveAccount(account)
|
||||
if err != nil {
|
||||
|
||||
@@ -101,6 +101,12 @@ func restore(file string) (*FileStore, error) {
|
||||
account.IsDomainPrimaryAccount {
|
||||
store.PrivateDomain2AccountID[account.Domain] = accountID
|
||||
}
|
||||
|
||||
// for data migration. Can be removed once most base will be with labels
|
||||
existingLabels := account.getPeerDNSLabels()
|
||||
if len(existingLabels) != len(account.Peers) {
|
||||
addPeerLabelsToAccount(account, existingLabels)
|
||||
}
|
||||
}
|
||||
|
||||
// we need this persist to apply changes we made to account.Peers (we set them to Disconnected)
|
||||
|
||||
Reference in New Issue
Block a user