Skip to content

fix(cni): Reject a whitespace-only eBPF interface override - #1265

Merged
privateip merged 1 commit into
mainfrom
fix/issue-1226
Oct 30, 2026
Merged

privateip merged 1 commit into
mainfrom
fix/issue-1226

Conversation

@privateip

Copy link
Copy Markdown
Contributor

Summary

An interface override made only of spaces was quietly treated as unset, so the CNI fell back to detecting uplinks from the routing table instead of reporting the bad value. It is now rejected the same way an override made only of commas already was, while an unset or empty override still means auto-detect.

The unit test for this case also read the real routing table, so it failed on machines with an IPv6 route and passed on CI runners. The override tests no longer touch the host and fail if any case falls through to detection.

Test plan

  • Lint, build, unit and e2e pass
  • Whitespace-only and whitespace-plus-commas overrides are rejected on a host with an IPv6 default route
  • An empty override still auto-detects

Fixes #1226

ResolveInterfaces trimmed GALACTIC_CNI_EBPF_INTERFACES before deciding whether it was set, so a value made only of whitespace was treated as unset and fell through to auto-detection, while a value made only of commas was rejected. The override is now considered set whenever the raw value is non-empty, and a set value that yields no interface names is an error either way. An unset or empty variable still auto-detects.

The override unit test stubbed bond expansion but not the route and link lookups auto-detection uses, so the whitespace case read the host's routing table and passed or failed depending on whether the machine had a usable IPv6 route. The override cases now stub both lookups and fail if any case reaches auto-detection.

Fixes #1226
@privateip privateip self-assigned this Oct 30, 2026
@privateip
privateip marked this pull request as ready for review October 30, 2026 02:06
@privateip
privateip enabled auto-merge October 30, 2026 02:06
@privateip
privateip requested a review from a team as a code owner October 30, 2026 02:06
@privateip

Copy link
Copy Markdown
Contributor Author

Two independent reviews ran on head 7c2e6ab, and both returned merge with nothing above a nit.

The correctness review read the diff against the approved plan in #1226, checked that the new stubs are restored and reset per case, reran the resolver tests and ran the linter on the package. The conventions review checked the title, body, commit message and open pull requests touching the same files.

Two nits stay open. One doc comment line runs longer than its neighbours, and draft #598 edits the same doc page, so whichever lands second may need a rebase.

Required checks are green on this head. Auto-merge is on and waits for a code owner approval.

@ecv ecv 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.

Approve.

GALACTIC_CNI_EBPF_INTERFACES set to whitespace only is now an error, like a value of only commas, instead of silently falling through to auto-detection. The decision uses the raw value, so unset or empty still auto-detects, and the test now fails if any override case reaches the routing table.

@privateip
privateip merged commit 6dd168d into main Oct 30, 2026
26 checks passed
@privateip
privateip deleted the fix/issue-1226 branch October 30, 2026 02:13
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.

Uplink override unit test fails on hosts with an IPv6 route

2 participants