summaryrefslogtreecommitdiff
path: root/cmd/podman/root.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-09-13 15:24:30 -0400
committerGitHub <noreply@github.com>2021-09-13 15:24:30 -0400
commit473f958e137eb9d8a3a3ef44cf3c17513243c18d (patch)
treed64e7a41dd760cb1cac2888fef97536279cef915 /cmd/podman/root.go
parent55a7f89fcae7ed8f16e10d4dae84cbdd3ecb1272 (diff)
parentba2130ff55d1410407d56c65d5592ee40d20fae2 (diff)
downloadpodman-473f958e137eb9d8a3a3ef44cf3c17513243c18d.tar.gz
podman-473f958e137eb9d8a3a3ef44cf3c17513243c18d.tar.bz2
podman-473f958e137eb9d8a3a3ef44cf3c17513243c18d.zip
Merge pull request #11545 from rhatdan/exitcodes
If container exits with 125 podman should exit with 125
Diffstat (limited to 'cmd/podman/root.go')
-rw-r--r--cmd/podman/root.go10
1 files changed, 3 insertions, 7 deletions
diff --git a/cmd/podman/root.go b/cmd/podman/root.go
index 371ded9a8..c798e6634 100644
--- a/cmd/podman/root.go
+++ b/cmd/podman/root.go
@@ -89,14 +89,10 @@ func init() {
func Execute() {
if err := rootCmd.ExecuteContext(registry.GetContextWithOptions()); err != nil {
+ if registry.GetExitCode() == 0 {
+ registry.SetExitCode(define.ExecErrorCodeGeneric)
+ }
fmt.Fprintln(os.Stderr, formatError(err))
- } else if registry.GetExitCode() == registry.ExecErrorCodeGeneric {
- // The exitCode modified from registry.ExecErrorCodeGeneric,
- // indicates an application
- // running inside of a container failed, as opposed to the
- // podman command failed. Must exit with that exit code
- // otherwise command exited correctly.
- registry.SetExitCode(0)
}
os.Exit(registry.GetExitCode())
}