Skip to content

docs+refactor(cni): fix stale package doc, promote hostconf/crdnames/nadpatch - #315

Open
privateip wants to merge 1 commit into
refactor/cni-chain-4-installer-docsfrom
fix/cni-review-followups-doc-placement
Open

docs+refactor(cni): fix stale package doc, promote hostconf/crdnames/nadpatch#315
privateip wants to merge 1 commit into
refactor/cni-chain-4-installer-docsfrom
fix/cni-review-followups-doc-placement

Conversation

@privateip

Copy link
Copy Markdown
Contributor

Follow-up to mattdjenkinson's review on #303 — 2 of the review's 5 points. The other 3 are handled separately:

  • The isTapMode()/CNI_NETNS_OVERRIDE dead-code point was already resolved upstream in this stack (725ef87, this branch's own parent).
  • The missing nil-tracker.k8s guard point is now moot — the BGP publish call it was about no longer lives in ops_add.go at all (moved to its own galactic-bgp chain plugin in e33092c).
  • The internal/cnitap vs internal/cni duplication point is a separate, larger follow-up: #(fix/cni-review-followups-dedup), stacked on top of this branch.

I'll leave a comment on #303 summarizing all 5.

This PR

internal/cni/doc.go staleness. The package doc still said ADD creates "a veth or tap interface" and listed tap as one of this package's subpackages — both stale since step 0 of this stack made galactic-cni veth-only and moved tap to galactic-tap-cni/internal/cnitap. Rewrote the doc to describe what internal/cni actually does now (VRF + veth pair + NAD patch only) and to explain why internal/cni/ipam, internal/cni/route, and internal/cni/tap are still physically nested there despite no longer being used by this package itself.

Package placement inconsistency. hostconf, crdnames, and nadpatch were nested under internal/cni/* while cnibgp/cniipam/cnitap/cniroute — doing the same cross-binary-sharing job — got promoted to top-level internal/*. That made it look like internal/cnitap (and cnibgp/cniroute) were reaching into cni's own internals, which is exactly what extracting them in the first place was meant to avoid. Promoted all three to internal/hostconf, internal/crdnames, internal/nadpatch. Package names are unchanged — every call site is a mechanical import-path update (15 files) plus two doc references (ARCHITECTURE.md, a comment in internal/cniroute/config.go).

internal/cni/ipam, internal/cni/route, and internal/cni/tap are a different category (kernel-primitive packages, like veth) and weren't part of this review point, so they're untouched.

Verification

  • task lint
  • task build ✅ (all 8 binaries)
  • go vet ./...
  • task test:unit ✅ (33/33 packages passing)
  • task test:e2e not run (same caveat as every step in this stack — needs a Kind cluster bring-up not attempted here)

🤖 Generated with Claude Code

@privateip
privateip requested a review from a team as a code owner August 8, 2026 18:55
@privateip
privateip requested review from fr6nco and removed request for a team August 8, 2026 18:55
@privateip
privateip force-pushed the refactor/cni-chain-4-installer-docs branch from 725ef87 to c690b5b Compare August 8, 2026 19:04
…nadpatch

Follow-up to mattdjenkinson's review on #303 (2 of 5 points; the other
3 are handled separately — 1 already resolved upstream in this stack,
1 is now moot, 1 is the dedup fix in a stacked follow-up branch).

internal/cni/doc.go still described the package as creating "a veth or
tap interface" and listed a tap subpackage as its own, both stale since
step 0 of this stack made galactic-cni veth-only and moved tap to its
own binary (galactic-tap-cni/internal/cnitap). Rewrote the package doc
to describe what internal/cni actually does now (VRF + veth pair + NAD
patch only — IPAM, termination routes, and BGP publish are galactic-
ipam's/galactic-route's/galactic-bgp's own concerns, chained after this
plugin) and to explain why internal/cni/ipam, internal/cni/route, and
internal/cni/tap are still physically nested here despite no longer
being used by this package itself.

Promoted hostconf, crdnames, and nadpatch from internal/cni/* to
top-level internal/*, matching the placement cnibgp/cniipam/cnitap/
cniroute already have. All four groups do the same cross-binary-
sharing job; leaving hostconf/crdnames/nadpatch nested under
internal/cni made it look like internal/cnitap (and cnibgp/cniroute)
were reaching into cni's own internals, which is exactly what
extracting them in the first place was meant to avoid. Package names
are unchanged — every call site is a mechanical import-path update
(15 files).

internal/cni/ipam, internal/cni/route, and internal/cni/tap are a
different category (kernel-primitive packages, like veth) and were not
part of this review point, so they're untouched.

task lint / task build / task test:unit all clean.
@privateip
privateip force-pushed the fix/cni-review-followups-doc-placement branch from 5f1d26b to 6cd671f Compare August 8, 2026 19:06
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.

1 participant