diff options
| author | Marwan Sulaiman <marwan@tailscale.com> | 2023-09-05 13:51:52 -0400 |
|---|---|---|
| committer | Marwan Sulaiman <marwan@tailscale.com> | 2023-09-05 13:51:52 -0400 |
| commit | ce16658ac0e032e9524bac8f5fc926b11f82a7a7 (patch) | |
| tree | 7ccf2dd7c97b1d5996c4ca709818edc529b34f81 /ipn/ipn_clone.go | |
| parent | a4aa6507fa3afa586dc3cbbf85f2cae852622b9e (diff) | |
| download | tailscale-marwan/postmem.tar.xz tailscale-marwan/postmem.zip | |
ipn, ipn/ipnlocal: add Foreground field for ServeConfigmarwan/postmem
This PR adds a new field to the serve config that can be used to identify which serves are in "foreground mode" and then can also be used to ensure they do not get persisted to disk so that if Tailscaled gets ungracefully shutdown, the reloaded ServeConfig will not have those ports opened.
Updates #8489
Signed-off-by: Marwan Sulaiman <marwan@tailscale.com>
Diffstat (limited to 'ipn/ipn_clone.go')
| -rw-r--r-- | ipn/ipn_clone.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/ipn/ipn_clone.go b/ipn/ipn_clone.go index 90718fb8d..5f30caa92 100644 --- a/ipn/ipn_clone.go +++ b/ipn/ipn_clone.go @@ -76,6 +76,12 @@ func (src *ServeConfig) Clone() *ServeConfig { } } dst.AllowFunnel = maps.Clone(src.AllowFunnel) + if dst.Foreground != nil { + dst.Foreground = map[string]*ServeConfig{} + for k, v := range src.Foreground { + dst.Foreground[k] = v.Clone() + } + } return dst } @@ -84,6 +90,7 @@ var _ServeConfigCloneNeedsRegeneration = ServeConfig(struct { TCP map[uint16]*TCPPortHandler Web map[HostPort]*WebServerConfig AllowFunnel map[HostPort]bool + Foreground map[string]*ServeConfig }{}) // Clone makes a deep copy of TCPPortHandler. |
