Skip to content

fix(cni): grant galactic-cni get on network-attachment-definitions - #412

Merged
privateip merged 1 commit into
mainfrom
fix/cni-rbac-nad-get
Aug 17, 2026
Merged

fix(cni): grant galactic-cni get on network-attachment-definitions#412
privateip merged 1 commit into
mainfrom
fix/cni-rbac-nad-get

Conversation

@privateip

Copy link
Copy Markdown
Contributor

Summary

d3c1ca3 (#331) added a Get call on the pod's
NetworkAttachmentDefinition before creating any kernel state
(internal/nadpatch.VerifyChainComplete), but the galactic-cni
ClusterRole only granted patch on network-attachment-definitions
the verb the later NAD-annotation step needs, not this new pre-check.

Every ADD failed Forbidden before any interface, VRF, or route was
created, wedging every pod attaching through the "private" NAD chain in
ContainerCreating.

Test plan

  • Applied to all three deploy/containerlab clusters; task verify
    passes (bgp-transit, bgp-fabric, bgp-peers, srv6, evpn, gateway,
    ns10–ns40 scenarios all green).

🤖 Generated with Claude Code

@privateip
privateip requested a review from a team as a code owner August 15, 2026 21:17
@privateip
privateip enabled auto-merge August 16, 2026 15:00
d3c1ca3 (#331, chain completeness check) added a Get call on the pod's
NetworkAttachmentDefinition before creating any kernel state
(internal/nadpatch.VerifyChainComplete, wired into
internal/cni/ops_add.go and internal/cnitap/ops_add.go), but the
galactic-cni ClusterRole only ever granted "patch" on
network-attachment-definitions — the verb needed for the later NAD
annotation step, not this new pre-check.

With the RBAC gap, every ADD failed with a Forbidden error before any
interface, VRF, or route was created:

  chain completeness check: get NetworkAttachmentDefinition ns10/private:
  network-attachment-definitions.k8s.cni.cncf.io "private" is forbidden:
  User "system:serviceaccount:galactic-system:galactic-cni" cannot get
  resource "network-attachment-definitions" in API group
  "k8s.cni.cncf.io" in the namespace "ns10"

Every pod attaching through the "private" NAD chain wedged in
ContainerCreating. Found while running deploy/containerlab's
task verify.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@privateip
privateip force-pushed the fix/cni-rbac-nad-get branch from 2433bfa to 8111ffe Compare August 17, 2026 20:35

@0xmc 0xmc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@privateip
privateip merged commit 11feb9b into main Aug 17, 2026
11 checks passed
@privateip
privateip deleted the fix/cni-rbac-nad-get branch August 17, 2026 20:53
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