ipn/ipnlocal: skip writing netmaps to disk when disabled (#18883)
We use the TS_USE_CACHED_NETMAP knob to condition loading a cached netmap, but were hitherto writing the map out to disk even when it was disabled. Let's not do that; the two should travel together. Updates #12639 Change-Id: Iee5aa828e2c59937d5b95093ea1ac26c9536721e Signed-off-by: M. J. Fromberger <fromberger@tailscale.com>
This commit is contained in:
@@ -6241,8 +6241,10 @@ func (b *LocalBackend) setNetMapLocked(nm *netmap.NetworkMap) {
|
|||||||
var login string
|
var login string
|
||||||
if nm != nil {
|
if nm != nil {
|
||||||
login = cmp.Or(profileFromView(nm.UserProfiles[nm.User()]).LoginName, "<missing-profile>")
|
login = cmp.Or(profileFromView(nm.UserProfiles[nm.User()]).LoginName, "<missing-profile>")
|
||||||
if err := b.writeNetmapToDiskLocked(nm); err != nil {
|
if envknob.Bool("TS_USE_CACHED_NETMAP") {
|
||||||
b.logf("write netmap to cache: %v", err)
|
if err := b.writeNetmapToDiskLocked(nm); err != nil {
|
||||||
|
b.logf("write netmap to cache: %v", err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
b.currentNode().SetNetMap(nm)
|
b.currentNode().SetNetMap(nm)
|
||||||
|
|||||||
Reference in New Issue
Block a user