fix: delete correct NetworkPolicy name on session cleanup#41
Merged
fix: delete correct NetworkPolicy name on session cleanup#41
Conversation
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>
|
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 |
Owner
Author
|
lmao yes it was |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
DeleteNetworkRestrictionwas deletingsess-<id>-network-restrictbutConfigureNetworkcreates the policy assess-<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):DeleteNetworkRestriction(old, line 1146):The tailnet policy name (
sess-%s-tailnet-access) was already correct.Test plan
go build ./services/control-plane/...go test ./services/control-plane/...kubectl --context netclode -n netclode get networkpolicies