Skip to content

fix: honor output-tcp-flags in JSON output#691

Merged
rgo3 merged 1 commit into
cilium:mainfrom
immanuwell:fix-output-json-tcp-flags
Jul 13, 2026
Merged

fix: honor output-tcp-flags in JSON output#691
rgo3 merged 1 commit into
cilium:mainfrom
immanuwell:fix-output-json-tcp-flags

Conversation

@immanuwell

Copy link
Copy Markdown
Contributor

--output-tcp-flags works in text output, but JSON was doing its own thing and always emitted tuple.flags.

Repro
go test ./internal/pwru -run TestPrintJSONHonorsOutputTCPFlags -count=1
Before this patch it fails, tuple.flags is still there when the flag is off.

Fix
Only set tuple.flags for JSON when --output-tcp-flags is enabled.
Added tests for both off and on cases.

@immanuwell immanuwell requested a review from a team as a code owner July 7, 2026 05:06
@immanuwell immanuwell requested review from rgo3 and removed request for a team July 7, 2026 05:06

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

Thanks for the PR. Two suggestions inline.

Comment thread internal/pwru/output.go
Comment thread internal/pwru/output_test.go Outdated
@immanuwell

Copy link
Copy Markdown
Contributor Author

@rgo3 addressed all suggestions, PTAL

@immanuwell immanuwell requested a review from rgo3 July 10, 2026 09:41
Comment thread internal/pwru/output_test.go Outdated
@immanuwell immanuwell force-pushed the fix-output-json-tcp-flags branch from 33c1ce4 to 86b2d1b Compare July 10, 2026 18:02
@immanuwell immanuwell requested a review from rgo3 July 10, 2026 18:03
@immanuwell

Copy link
Copy Markdown
Contributor Author

@rgo3 please take a look

Signed-off-by: immanuwell <pchpr.00@list.ru>
@rgo3 rgo3 force-pushed the fix-output-json-tcp-flags branch from 86b2d1b to 5211d51 Compare July 13, 2026 09:59

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

Simplified it a bit, guess I kinda led you a stray with that many test options. Thanks for contributing!

@rgo3 rgo3 merged commit cf91fbf into cilium:main Jul 13, 2026
17 of 18 checks passed
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