Skip to content

fix: delete correct NetworkPolicy name on session cleanup#41

Merged
angristan merged 1 commit intomasterfrom
fix/networkpolicy-cleanup-naming
Feb 13, 2026
Merged

fix: delete correct NetworkPolicy name on session cleanup#41
angristan merged 1 commit intomasterfrom
fix/networkpolicy-cleanup-naming

Conversation

@angristan
Copy link
Owner

@angristan angristan commented Feb 8, 2026

Summary

  • DeleteNetworkRestriction was deleting sess-<id>-network-restrict but ConfigureNetwork creates the policy as sess-<id>-internet-access. This caused internet-access egress policies to leak on every session pause/delete, accumulating orphaned NetworkPolicies over time.

Details

ConfigureNetwork (line 981):

internetPolicyName := fmt.Sprintf("sess-%s-internet-access", sessionID)

DeleteNetworkRestriction (old, line 1146):

restrictPolicyName := fmt.Sprintf("sess-%s-network-restrict", sessionID) // wrong name

The tailnet policy name (sess-%s-tailnet-access) was already correct.

Test plan

  • go build ./services/control-plane/...
  • go test ./services/control-plane/...
  • After deploy, verify orphaned policies are cleaned up on session delete: kubectl --context netclode -n netclode get networkpolicies

DeleteNetworkRestriction was deleting `sess-<id>-network-restrict` but
ConfigureNetwork creates the policy as `sess-<id>-internet-access`.
This caused internet-access egress policies to leak on every session
pause/delete.

🐘 Generated with Crush

Assisted-by: Claude Opus 4.6 via Crush <crush@charm.land>
@ellie
Copy link

ellie commented Feb 10, 2026

I just used this to bootstrap a new machine running on hetzner - nice changes, especially the Codex stuff! If there's anything needed to get it merged, happy to help

@angristan
Copy link
Owner Author

@ellie was this meant for #40? 👀

@angristan angristan marked this pull request as ready for review February 13, 2026 17:01
@angristan angristan merged commit 94ea506 into master Feb 13, 2026
1 check passed
@ellie
Copy link

ellie commented Feb 13, 2026

lmao yes it was

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.

2 participants