Skip to content

fix: clean up malformed CNI error output#762

Open
immanuwell wants to merge 1 commit into
linkerd:mainfrom
immanuwell:fix/cni-error-formatting
Open

fix: clean up malformed CNI error output#762
immanuwell wants to merge 1 commit into
linkerd:mainfrom
immanuwell:fix/cni-error-formatting

Conversation

@immanuwell

Copy link
Copy Markdown

This fixes a small but real logging bug in cni-plugin.

Some CNI error paths use %e for error, so Go prints %!e(...) junk instead of the actual message. That shows up on normal failures like bad CNI JSON, bad kube config, or missing integration mounts. Kinda noisy, and it hides the real problem.

What changed

  • switch those log and test format strings to %v or %s
  • add a small regression test for the invalid JSON path
  • fix the proxy-gid mismatch message in the integration test helper

Repro

  1. On main, run go test ./cni-plugin/integration/tests/flannel -run TestLinkerdIsLastCNIPlugin -v
  2. In a plain local env, the expected mount is missing, so the test fails
  3. Before this patch the failure contains %!e(...)
  4. With this patch it prints the real path error

Checks

  • go test ./cni-plugin ./proxy-init/... ./pkg/...

Signed-off-by: immanuwell <pchpr.00@list.ru>
@immanuwell immanuwell requested a review from a team as a code owner June 8, 2026 09:41
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