This commit contains the changes for the following:

1. Patch prefs handler doesn't add the remote routes to pref if the pref update is also turning appconnector off.
2. Unadvertise routes when StoreRoutes is on but appConnector is turning off.
3. When appConnector is turning on, add a task to recreate and reload routeInfo from store to the queue
3. When shouldStore is changed, remove the state saved for routeInfo (Set to nil)
This commit is contained in:
Kevin Liang
2024-04-08 02:21:07 +00:00
parent 150b52f387
commit c76d54a5c1
5 changed files with 69 additions and 33 deletions

View File

@@ -8,6 +8,7 @@ import (
"slices"
"tailscale.com/appc/routeinfo"
"tailscale.com/ipn"
)
// RouteCollector is a test helper that collects the list of routes advertised
@@ -42,7 +43,7 @@ func (rc *RouteCollector) StoreRouteInfo(ri *routeinfo.RouteInfo) error {
func (rc *RouteCollector) ReadRouteInfo() (*routeinfo.RouteInfo, error) {
if rc.routeInfo == nil {
return routeinfo.NewRouteInfo(), nil
return nil, ipn.ErrStateNotExist
}
return rc.routeInfo, nil
}