Skip to content

fix: honor output-tunnel in JSON output#690

Merged
smagnani96 merged 1 commit into
cilium:mainfrom
immanuwell:fix/json-output-tunnel-flag
Jul 6, 2026
Merged

fix: honor output-tunnel in JSON output#690
smagnani96 merged 1 commit into
cilium:mainfrom
immanuwell:fix/json-output-tunnel-flag

Conversation

@immanuwell

Copy link
Copy Markdown
Contributor

PrintJson() checked OutputTuple for tunnel_tuple, not OutputTunnel.

So 2 cases get kinda weird:

  • pwru --output-json --output-tunnel --output-tuple=false drops tunnel_tuple
  • pwru --output-json --output-tuple --output-tunnel=false still prints tunnel_tuple

This switches the guard to OutputTunnel and adds regression tests. Pretty small fix, but it keeps JSON output lined up with the flags.

Repro:

  1. Run go test ./internal/pwru -run "TestPrintJSON|TestGetAbsoluteTs" -v
  2. Before the fix, the 2 TestPrintJSON... cases fail
  3. With this patch, they pass

@immanuwell immanuwell requested a review from a team as a code owner July 4, 2026 10:23
@immanuwell immanuwell requested review from smagnani96 and removed request for a team July 4, 2026 10:23
@immanuwell immanuwell force-pushed the fix/json-output-tunnel-flag branch from f938b57 to e96e564 Compare July 4, 2026 10:25
Signed-off-by: immanuwell <pchpr.00@list.ru>

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

Looks good, thanks for the catch 👍🏼

@smagnani96 smagnani96 added the bug Something isn't working label Jul 6, 2026
@smagnani96 smagnani96 merged commit 99f49aa into cilium:main Jul 6, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants