mirror of
https://github.com/juanfont/headscale.git
synced 2025-05-27 01:18:48 +02:00
hsic: only set db policy if exist
Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
This commit is contained in:
parent
52d65d77b8
commit
e02987cfef
@ -448,7 +448,7 @@ func New(
|
||||
|
||||
// Load the database from policy file on repeat until it succeeds,
|
||||
// this is done as the container sleeps before starting headscale.
|
||||
if hsic.policyMode == types.PolicyModeDB {
|
||||
if hsic.aclPolicy != nil && hsic.policyMode == types.PolicyModeDB {
|
||||
err := pool.Retry(hsic.reloadDatabasePolicy)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("loading database policy on startup: %w", err)
|
||||
|
@ -1401,7 +1401,7 @@ func TestAutoApproveMultiNetwork(t *testing.T) {
|
||||
},
|
||||
},
|
||||
TagOwners: map[string][]string{
|
||||
"tag:approve": {"user1"},
|
||||
"tag:approve": {"user1@"},
|
||||
},
|
||||
AutoApprovers: policyv1.AutoApprovers{
|
||||
Routes: map[string][]string{
|
||||
@ -1598,6 +1598,7 @@ func TestAutoApproveMultiNetwork(t *testing.T) {
|
||||
peerStatus := status.Peer[peerKey]
|
||||
|
||||
if peerStatus.ID == "1" {
|
||||
require.NotNil(t, peerStatus.PrimaryRoutes)
|
||||
assert.Contains(t, peerStatus.PrimaryRoutes.AsSlice(), *route)
|
||||
requirePeerSubnetRoutes(t, peerStatus, []netip.Prefix{*route})
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user