diff options
| author | Avery Pennarun <apenwarr@tailscale.com> | 2026-04-10 21:50:39 +0200 |
|---|---|---|
| committer | Avery Pennarun <apenwarr@tailscale.com> | 2026-04-11 21:21:11 +0200 |
| commit | ff4d495e39b5680f65afe66e2ea7206c3c578e60 (patch) | |
| tree | 5e75e4bb6feabe828098073459fcd0dc2fd1e083 | |
| parent | 66918a65f6413da987064e3abb794bce9f5942db (diff) | |
| download | tailscale-apenwarr/aperture.tar.xz tailscale-apenwarr/aperture.zip | |
ipn/ipnlocal: add TS_FORCE_CACHE_NETMAP envknob to force netmap cachingapenwarr/aperture
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>
| -rw-r--r-- | ipn/ipnlocal/local.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ipn/ipnlocal/local.go b/ipn/ipnlocal/local.go index 610d1d7b5..1c8c1e9b8 100644 --- a/ipn/ipnlocal/local.go +++ b/ipn/ipnlocal/local.go @@ -6518,7 +6518,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(tailcfg.NodeAttrCacheNetworkMaps) && envknob.BoolDefaultTrue("TS_USE_CACHED_NETMAP") { + if (b.currentNode().SelfHasCap(tailcfg.NodeAttrCacheNetworkMaps) || envknob.Bool("TS_FORCE_CACHE_NETMAP")) && envknob.BoolDefaultTrue("TS_USE_CACHED_NETMAP") { if err := b.writeNetmapToDiskLocked(nm); err != nil { b.logf("write netmap to cache: %v", err) } |
