mirror of
https://github.com/juanfont/headscale.git
synced 2026-11-04 12:39:25 +09:00
state: drop auto-approved routes when they are withdrawn
Only routes auto-approval alone granted go; approvals from before the upgrade stay, as do routes an admin set.
This commit is contained in:
1 parent
070fe4c9bd
commit
e481fe49d3
5 files changed
+215
-66
No files matched your search
@@ -3008,7 +3008,9 @@ func TestAutoApproveMultiNetwork(t *testing.T) {
|
||||
nodes, err = headscale.ListNodes()
|
||||
assert.NoError(c, err)
|
||||
requireNodeRouteCountWithCollect(c, MustFindNode(routerUsernet1.Hostname(), nodes), 1, 1, 1)
|
||||
requireNodeRouteCountWithCollect(c, nodes[1], 1, 1, 0)
|
||||
// The withdrawn sub-route was auto-approved, so it loses
|
||||
// its approval.
|
||||
requireNodeRouteCountWithCollect(c, nodes[1], 1, 0, 0)
|
||||
requireNodeRouteCountWithCollect(c, nodes[2], 0, 0, 0)
|
||||
}, assertTimeout, 500*time.Millisecond, "route state changes should propagate")
|
||||
|
||||
@@ -3048,7 +3050,7 @@ func TestAutoApproveMultiNetwork(t *testing.T) {
|
||||
nodes, err = headscale.ListNodes()
|
||||
assert.NoError(c, err)
|
||||
requireNodeRouteCountWithCollect(c, MustFindNode(routerUsernet1.Hostname(), nodes), 1, 1, 1)
|
||||
requireNodeRouteCountWithCollect(c, nodes[1], 1, 1, 0)
|
||||
requireNodeRouteCountWithCollect(c, nodes[1], 1, 0, 0)
|
||||
requireNodeRouteCountWithCollect(c, nodes[2], 2, 2, 2)
|
||||
}, assertTimeout, 500*time.Millisecond, "route state changes should propagate")
|
||||
|
||||
|
||||
Reference in new issue
Block a user