Skip to content

Commit 7c6b85b

Browse files
authored
[management] Refactor routes to use store methods (#2928)
1 parent 08c9107 commit 7c6b85b

File tree

10 files changed

+412
-240
lines changed

10 files changed

+412
-240
lines changed

client/cmd/system.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,5 @@ func init() {
3838

3939
upCmd.PersistentFlags().BoolVar(&blockInbound, blockInboundFlag, false,
4040
"Block inbound connections. If enabled, the client will not allow any inbound connections to the local machine nor routed networks.\n"+
41-
"This overrides any policies received from the management service.")
41+
"This overrides any policies received from the management service.")
4242
}

client/internal/routemanager/mock.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
// MockManager is the mock instance of a route manager
1616
type MockManager struct {
1717
ClassifyRoutesFunc func(routes []*route.Route) (map[route.ID]*route.Route, route.HAMap)
18-
UpdateRoutesFunc func (updateSerial uint64, serverRoutes map[route.ID]*route.Route, clientRoutes route.HAMap, useNewDNSRoute bool) error
18+
UpdateRoutesFunc func(updateSerial uint64, serverRoutes map[route.ID]*route.Route, clientRoutes route.HAMap, useNewDNSRoute bool) error
1919
TriggerSelectionFunc func(haMap route.HAMap)
2020
GetRouteSelectorFunc func() *routeselector.RouteSelector
2121
GetClientRoutesFunc func() route.HAMap

client/system/info.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,16 @@ type Info struct {
5959
Environment Environment
6060
Files []File // for posture checks
6161

62-
RosenpassEnabled bool
63-
RosenpassPermissive bool
64-
ServerSSHAllowed bool
65-
66-
DisableClientRoutes bool
67-
DisableServerRoutes bool
68-
DisableDNS bool
69-
DisableFirewall bool
70-
BlockLANAccess bool
71-
BlockInbound bool
62+
RosenpassEnabled bool
63+
RosenpassPermissive bool
64+
ServerSSHAllowed bool
65+
66+
DisableClientRoutes bool
67+
DisableServerRoutes bool
68+
DisableDNS bool
69+
DisableFirewall bool
70+
BlockLANAccess bool
71+
BlockInbound bool
7272

7373
LazyConnectionEnabled bool
7474
}

management/server/group.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -664,15 +664,6 @@ func areGroupChangesAffectPeers(ctx context.Context, transaction store.Store, ac
664664
return false, nil
665665
}
666666

667-
func (am *DefaultAccountManager) anyGroupHasPeers(account *types.Account, groupIDs []string) bool {
668-
for _, groupID := range groupIDs {
669-
if group, exists := account.Groups[groupID]; exists && group.HasPeers() {
670-
return true
671-
}
672-
}
673-
return false
674-
}
675-
676667
// anyGroupHasPeersOrResources checks if any of the given groups in the account have peers or resources.
677668
func anyGroupHasPeersOrResources(ctx context.Context, transaction store.Store, accountID string, groupIDs []string) (bool, error) {
678669
groups, err := transaction.GetGroupsByIDs(ctx, store.LockingStrengthShare, accountID, groupIDs)

0 commit comments

Comments
 (0)