mirror of
https://github.com/netbirdio/netbird.git
synced 2026-10-05 21:19:08 +02:00
Merge pull request #4504 from netbirdio/sub-feat/auto-upgrade/move-version-networkmap
Move autoUpdateVersion inside NetworkMap
This commit is contained in:
@@ -52,8 +52,6 @@ const (
|
||||
peerSchedulerRetryInterval = 3 * time.Second
|
||||
emptyUserID = "empty user ID in claims"
|
||||
errorGettingDomainAccIDFmt = "error getting account ID by private domain: %v"
|
||||
// skipAutoUpdateVersion used as a placeholder for autoUpdateVersion in proto responses to indicate response contains no new updates
|
||||
skipAutoUpdateVersion = "skip"
|
||||
)
|
||||
|
||||
type userLoggedInOnce bool
|
||||
|
||||
@@ -710,6 +710,7 @@ func toPeerConfig(peer *nbpeer.Peer, network *types.Network, dnsName string, set
|
||||
Fqdn: fqdn,
|
||||
RoutingPeerDnsResolutionEnabled: settings.RoutingPeerDNSResolutionEnabled,
|
||||
LazyConnectionEnabled: settings.LazyConnectionEnabled,
|
||||
AutoUpdateVersion: settings.AutoUpdateVersion,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -717,12 +718,12 @@ func toSyncResponse(ctx context.Context, config *nbconfig.Config, peer *nbpeer.P
|
||||
response := &proto.SyncResponse{
|
||||
PeerConfig: toPeerConfig(peer, networkMap.Network, dnsName, settings),
|
||||
NetworkMap: &proto.NetworkMap{
|
||||
Serial: networkMap.Network.CurrentSerial(),
|
||||
Routes: toProtocolRoutes(networkMap.Routes),
|
||||
DNSConfig: toProtocolDNSConfig(networkMap.DNSConfig, dnsCache),
|
||||
Serial: networkMap.Network.CurrentSerial(),
|
||||
Routes: toProtocolRoutes(networkMap.Routes),
|
||||
DNSConfig: toProtocolDNSConfig(networkMap.DNSConfig, dnsCache),
|
||||
PeerConfig: toPeerConfig(peer, networkMap.Network, dnsName, settings),
|
||||
},
|
||||
Checks: toProtocolChecks(ctx, checks),
|
||||
AutoUpdateVersion: settings.AutoUpdateVersion,
|
||||
Checks: toProtocolChecks(ctx, checks),
|
||||
}
|
||||
|
||||
nbConfig := toNetbirdConfig(config, turnCredentials, relayCredentials, extraSettings)
|
||||
|
||||
@@ -1554,8 +1554,8 @@ func deletePeers(ctx context.Context, am *DefaultAccountManager, transaction sto
|
||||
RemotePeersIsEmpty: true,
|
||||
FirewallRules: []*proto.FirewallRule{},
|
||||
FirewallRulesIsEmpty: true,
|
||||
PeerConfig: toPeerConfig(peer, network, dnsDomain, settings),
|
||||
},
|
||||
AutoUpdateVersion: settings.AutoUpdateVersion,
|
||||
},
|
||||
NetworkMap: &types.NetworkMap{},
|
||||
})
|
||||
|
||||
@@ -210,7 +210,6 @@ func (m *TimeBasedAuthSecretsManager) pushNewTURNAndRelayTokens(ctx context.Cont
|
||||
NetbirdConfig: &proto.NetbirdConfig{
|
||||
Turns: turns,
|
||||
},
|
||||
AutoUpdateVersion: skipAutoUpdateVersion,
|
||||
}
|
||||
|
||||
// workaround for the case when client is unable to handle turn and relay updates at different time
|
||||
@@ -247,7 +246,6 @@ func (m *TimeBasedAuthSecretsManager) pushNewRelayTokens(ctx context.Context, ac
|
||||
},
|
||||
// omit Turns to avoid updates there
|
||||
},
|
||||
AutoUpdateVersion: skipAutoUpdateVersion,
|
||||
}
|
||||
|
||||
m.extendNetbirdConfig(ctx, peerID, accountID, update)
|
||||
|
||||
Reference in New Issue
Block a user