Podman machine ssh does not preserve exit status from SSH #14401
Labels
kind/bug
Categorizes issue or PR as related to a bug.
locked - please file new issue/PR
Assist humans wanting to comment on an old issue or PR with locked comments.
machine
macos
MacOS (OSX) related
remote
Problem is in podman-remote
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
When executing a command against the Podman VM the exit status of the command is not preserved and relayed back to the host correctly. It is a standard expectation that the exit status is preserved, after all, SSH itself does.
Steps to reproduce the issue:
podman machine ssh exit 5 ; echo $?
incorrectly yields125
and it should be5
podman machine ssh exit 0 ; echo $?
correctly yields0
ssh -i ~/.ssh/podman-machine-default -p <podman-port> core@localhost exit 5 ; echo $?
correctly yields5
ssh -i ~/.ssh/podman-machine-default -p <podman-port> core@localhost exit 0 ; echo $?
correctly yields0
Describe the results you received:
Whenever the lasts executed command via
podman machine ssh
returns a non-zero exit status in the VM the result of$?
on the host for last process exit status is incorrectly and always reported as125
.Describe the results you expected:
The exit status as returned in the VM from the last command execution should be accurately reflected on the host via
$?
, just likessh
.Additional information you deem important (e.g. issue happens only occasionally):
Output of
podman version
:Output of
podman info --debug
:Package info (e.g. output of
brew info podman
):Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/main/troubleshooting.md)
Yes
Additional environment details (AWS, VirtualBox, physical, etc.):
This behavior has been present since at least podman 3.4.4 on MacOS both M1 and Intel processors and includes, at least, Big Sur and Monterrey.
The text was updated successfully, but these errors were encountered: