Skip to content

pkg/domain: return an error instead of nil on remote event parse failure#29055

Open
ROKUMATE wants to merge 2 commits into
podman-container-tools:mainfrom
ROKUMATE:fix-remote-events-parse-error
Open

pkg/domain: return an error instead of nil on remote event parse failure#29055
ROKUMATE wants to merge 2 commits into
podman-container-tools:mainfrom
ROKUMATE:fix-remote-events-parse-error

Conversation

@ROKUMATE

@ROKUMATE ROKUMATE commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

What

In remote mode, podman events --format json could print the literal null
instead of an event object. ConvertToLibpodEvent returned nil on a parse
failure and the tunnel forwarded it as an event with no error set, so the nil
event was marshalled to null.

This returns an error from ConvertToLibpodEvent and sends it on the event
channel (which the CLI already handles) instead of a nil event.

Test

pkg/domain/entities/events_test.go: a valid event converts correctly, and
unknown status, unknown type, and an invalid containerExitCode each return an
error instead of nil.

Checklist

Does this PR introduce a user-facing change?

thepodman events --format json cmd no longer prints null when a server event can't be parsed ... it returns an error instead

@ROKUMATE ROKUMATE force-pushed the fix-remote-events-parse-error branch from fefb8b2 to a69f2e7 Compare June 26, 2026 10:10

@danishprakash danishprakash left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please refer to main/CONTRIBUTING.md main/LLM_POLICY.md.

And also it'd be helpful if you could follow the PR template for the description.

@ROKUMATE

Copy link
Copy Markdown
Contributor Author

@danishprakash i read it i added the checklist for now
and hanceforth in next pr wont use it for writting the pr description and all 👍🏼
any point i missed in the fix u would like me to check on ??

@packit-as-a-service

Copy link
Copy Markdown

[NON-BLOCKING] Packit jobs failed. @containers/packit-build please check. Everyone else, feel free to ignore.

ROKUMATE added 2 commits June 27, 2026 18:18
Signed-off-by: ROKUMATE <rohitkumawat0110@gmail.com>
Signed-off-by: ROKUMATE <rohitkumawat0110@gmail.com>
@ROKUMATE ROKUMATE force-pushed the fix-remote-events-parse-error branch from a69f2e7 to 88e6c48 Compare June 27, 2026 12:49
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.

podman events --format json returns null via remote api

2 participants