mirror of
https://github.com/tailscale/tailscale.git
synced 2026-12-06 23:36:34 +09:00
ipn/ipnlocal: add TS_FORCE_CACHE_NETMAP envknob to force netmap caching
Allow clients to force netmap caching via the TS_FORCE_CACHE_NETMAP environment variable, bypassing the requirement for the control server to grant the cache-network-maps node capability. This is useful for tsnet users who want faster startup times via cached netmaps but whose control plane doesn't grant the capability. Change-Id: I447b57311940d51a5ce9021236add48e0333d0b5 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
85095d76d9
commit
05f341cd93
1 file changed
+1
-1
@@ -8019,7 +8019,7 @@ func (b *LocalBackend) setNetMapLocked(nm *netmap.NetworkMap) {
|
||||
// not being updated (because of the envknob) and could be read back when
|
||||
// the node starts up.
|
||||
if nm != nil {
|
||||
if b.currentNode().SelfHasCap(nodecap.CacheNetworkMaps) && envknob.BoolDefaultTrue("TS_USE_CACHED_NETMAP") {
|
||||
if (b.currentNode().SelfHasCap(nodecap.CacheNetworkMaps) || envknob.Bool("TS_FORCE_CACHE_NETMAP")) && envknob.BoolDefaultTrue("TS_USE_CACHED_NETMAP") {
|
||||
if err := b.writeNetmapToDiskLockedWithPeers(nm); err != nil {
|
||||
b.logf("write netmap to cache: %v", err)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user