Skip to content

Conversation

@kradalby
Copy link
Collaborator

@kradalby kradalby commented Oct 19, 2025

autogroup:self uses per-node filters, causing stale peer maps when nodes
change (global filter hash unchanged). Fix by detecting autogroup:self
in SetNodes() and forcing peer map rebuild.

Replace blanket cache clearing with granular invalidation of affected
nodes only. Move ReduceFilterRules to policyutil package and add
NodeView.HasNetworkChanges() for network change detection.

Fixes #2802

Claude was used in this PR.

@kradalby kradalby force-pushed the kradalby/2802-acl-self-propagate branch 4 times, most recently from 12dc8b5 to f834379 Compare October 22, 2025 09:41
@kradalby kradalby changed the title integration: add acl test to validate propagation policy: fix autogroup:self propagation and optimize cache invalidation Oct 22, 2025
@kradalby kradalby force-pushed the kradalby/2802-acl-self-propagate branch from f834379 to 76d119c Compare October 22, 2025 09:47
@kradalby kradalby added this to the v0.27.0 milestone Oct 22, 2025
@kradalby kradalby force-pushed the kradalby/2802-acl-self-propagate branch from 76d119c to 3e605ee Compare October 22, 2025 13:53
kradalby added a commit to kradalby/headscale that referenced this pull request Oct 23, 2025
Implements two patterns to handle eventual consistency in integration tests:

1. Built-in backoff retry for simple accessors (FQDN, IPv4, IPs)
   - Functions return (value, error) with internal 10s exponential backoff
   - Added MustFQDN(), MustIPv4(), MustIPs() panic variants

2. EventuallyWithT wrapping for complex validation
   - Status(): 11 calls (peer visibility, expiration, tags)
   - ListNodes(): 6 calls (registration, routes)
   - Curl(): 11 calls (HTTP connectivity)
   - Netmap(): 1 call (network map validation)

All 336 external state calls now have proper retry logic.

Fixes juanfont#2807
@kradalby kradalby force-pushed the kradalby/2802-acl-self-propagate branch from 57f9b64 to 35e27e3 Compare October 23, 2025 10:07
Add a ACL test that updates and validates node connectivity
over time as nodes and policy changes.

Updates juanfont#2802

Signed-off-by: Kristoffer Dalby <[email protected]>
kradalby added a commit to kradalby/headscale that referenced this pull request Oct 23, 2025
Implements two patterns to handle eventual consistency in integration tests:

1. Built-in backoff retry for simple accessors (FQDN, IPv4, IPs)
   - Functions return (value, error) with internal 10s exponential backoff
   - Added MustFQDN(), MustIPv4(), MustIPs() panic variants

2. EventuallyWithT wrapping for complex validation
   - Status(): 11 calls (peer visibility, expiration, tags)
   - ListNodes(): 6 calls (registration, routes)
   - Curl(): 11 calls (HTTP connectivity)
   - Netmap(): 1 call (network map validation)

All 336 external state calls now have proper retry logic.

Fixes juanfont#2807
@kradalby kradalby force-pushed the kradalby/2802-acl-self-propagate branch 2 times, most recently from a26837d to d763dad Compare October 23, 2025 13:51
autogroup:self uses per-node filters, causing stale peer maps when nodes
change (global filter hash unchanged). Fix by detecting autogroup:self
in SetNodes() and forcing peer map rebuild.

Replace blanket cache clearing with granular invalidation of affected
nodes only. Move ReduceFilterRules to policyutil package and add
NodeView.HasNetworkChanges() for network change detection.
- Remove trailing whitespace and extra blank lines
- Fix comment spacing
- Normalize indentation (spaces to tabs)
- Use octal prefix for file permissions
@kradalby kradalby force-pushed the kradalby/2802-acl-self-propagate branch from d763dad to f0281a1 Compare October 23, 2025 14:56
@kradalby kradalby marked this pull request as ready for review October 23, 2025 14:59
@kradalby kradalby merged commit 2bf1200 into juanfont:main Oct 23, 2025
170 of 176 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] ACL with autogroup:self is only pushed after restart

2 participants