mirror of
https://github.com/netbirdio/netbird.git
synced 2024-11-25 17:43:38 +01:00
Move dns label generation to store (#552)
This commit is contained in:
parent
a768a0aa8a
commit
7e262572a4
@ -384,12 +384,6 @@ func BuildManager(store Store, peersUpdateManager *PeersUpdateManager, idpManage
|
|||||||
shouldSave = true
|
shouldSave = true
|
||||||
}
|
}
|
||||||
|
|
||||||
existingLabels := account.getPeerDNSLabels()
|
|
||||||
if len(existingLabels) != len(account.Peers) {
|
|
||||||
addPeerLabelsToAccount(account, existingLabels)
|
|
||||||
shouldSave = true
|
|
||||||
}
|
|
||||||
|
|
||||||
if shouldSave {
|
if shouldSave {
|
||||||
err = store.SaveAccount(account)
|
err = store.SaveAccount(account)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -101,6 +101,12 @@ func restore(file string) (*FileStore, error) {
|
|||||||
account.IsDomainPrimaryAccount {
|
account.IsDomainPrimaryAccount {
|
||||||
store.PrivateDomain2AccountID[account.Domain] = accountID
|
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)
|
// we need this persist to apply changes we made to account.Peers (we set them to Disconnected)
|
||||||
|
Loading…
Reference in New Issue
Block a user