Skip to content

refactor!: Drop vpcAttachmentRef from NetworkRule - #31

Merged
privateip merged 1 commit into
mainfrom
refactor/networkrule-drop-vpcattachmentref
Oct 9, 2026
Merged

privateip merged 1 commit into
mainfrom
refactor/networkrule-drop-vpcattachmentref

Conversation

@privateip

Copy link
Copy Markdown
Collaborator

Summary

A NetworkRule picks its backends with backendSelector, which can match many VPCAttachments, so its required single-attachment vpcAttachmentRef no longer identifies anything. No consumer reads it, so this removes it from the API and the CRD.

NetworkEgressPolicy keeps its own vpcAttachmentRef, since an egress policy still applies to one attachment.

Breaking changes

A NetworkRule that still sets vpcAttachmentRef is rejected as an unknown field. Rules already stored lose the field once the new CRD is installed, and nothing reads it.

Galactic's containerlab lab and staging channel install these CRDs from main, and galactic's lab NetworkRules still set the field. Merge this right before the galactic pull request that drops it, so lab rules fail to apply only between the two merges. The staging lab's NetworkRule needs the same one-line removal.

Test plan

  • A rule with vpcRef, a selector and a backend port, and no vpcAttachmentRef, is accepted
  • A rule that sets vpcAttachmentRef is rejected as an unknown field (new chainsaw step)
  • Build, lint and unit tests pass
  • The e2e suite passes

🤖 Generated with Claude Code

A NetworkRule's backends come from backendSelector, which picks any number of VPCAttachments in vpcRef's VPC. A single attachment reference no longer identifies anything about the rule, and no consumer reads it: galactic only copied it into a struct and an error message.

Remove the field from NetworkRuleSpec, the CRD, the sample and the e2e test, and add an e2e step that a rule still setting it is rejected as an unknown field. Reword the shared Accepted reason comments, which also serve NetworkEgressPolicy, so they no longer name the field. NetworkEgressPolicy keeps its own vpcAttachmentRef.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@privateip
privateip requested a review from a team as a code owner October 9, 2026 01:31
@privateip
privateip merged commit 5e00bde into main Oct 9, 2026
5 checks passed
@privateip
privateip deleted the refactor/networkrule-drop-vpcattachmentref branch October 9, 2026 01:32
privateip added a commit to datum-cloud/galactic that referenced this pull request Oct 9, 2026
Point at network main now that datum-cloud/network#31, which drops NetworkRule's vpcAttachmentRef, has merged, rather than at that PR's branch commit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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