Skip to content

Revert 'Fix conmon exec exit status handling'#590

Merged
jnovy merged 1 commit intocontainers:mainfrom
jnovy:589
Sep 4, 2025
Merged

Revert 'Fix conmon exec exit status handling'#590
jnovy merged 1 commit intocontainers:mainfrom
jnovy:589

Conversation

@jnovy
Copy link
Collaborator

@jnovy jnovy commented Sep 4, 2025

The original fix introduced a regression where exec operations always returned exit code 0 instead of the actual command exit code. This broke podman health checks and exec exit code propagation.

The original code was working correctly - container_status contains the actual exit code of executed commands, while runtime_status only indicates whether the runtime successfully executed the command.

Testing shows:

  • Before fc0a342: exec commands return correct exit codes - OK
  • After fc0a342: exec commands always return 0 - NOT OK
  • After this revert: exec commands return correct exit codes - OK

Related issue: containers/podman#26981

Fixes: #589

fi

# Test 1: Success case
if ! podman exec "$container_id" true; then
Copy link
Member

Choose a reason for hiding this comment

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

Does this work if podman is run without the --conmon option?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Just re-pushed the PR. The test now explicitly uses the built conmon binary via --conmon flag, so it will work correctly regardless of system configuration and always tests the code being developed. This applies for local testing - the CI will always use the freshly built conmon binary regardless. But it's good to keep them both testing the development version.

Copy link
Member

@Honny1 Honny1 left a comment

Choose a reason for hiding this comment

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

The new test appears correct; however, I cannot comment on the other parts of the pull request.

The original fix introduced a regression where exec operations always
returned exit code 0 instead of the actual command exit code. This
broke podman health checks and exec exit code propagation.

The original code was working correctly - container_status contains
the actual exit code of executed commands, while runtime_status only
indicates whether the runtime successfully executed the command.

Testing shows:
- Before fc0a342: exec commands return correct exit codes - OK
- After fc0a342: exec commands always return 0 - NOT OK
- After this revert: exec commands return correct exit codes - OK

Related issue: containers/podman#26981

Fixes: containers#589

Signed-off-by: Jindrich Novy <jnovy@redhat.com>
Copy link
Member

@Luap99 Luap99 left a comment

Choose a reason for hiding this comment

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

reverting LGTM, I cannot really comment on the testing details here.

fmt:
git ls-files -z \*.c \*.h | xargs -0 clang-format -i

git ls-files -z '*.bats' | xargs -0 sed -i 's/[[:space:]]\+$$//'
Copy link
Member

Choose a reason for hiding this comment

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

should this be in this commit?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This one is just missing format fix for BATS tests to avoid trailing spaces - intentional.

@jnovy jnovy merged commit d53a143 into containers:main Sep 4, 2025
33 of 34 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.

Investigate regression uncovered by podman testing

3 participants