diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2021-09-12 08:51:53 -0400 |
---|---|---|
committer | Matthew Heon <mheon@redhat.com> | 2021-09-16 09:42:14 -0400 |
commit | c6e4453f6223bbb2b6cfd5242c0d9af55cd8b121 (patch) | |
tree | b3d6f7afeaf21f5a88216a96d572f4de8cdebf79 /cmd/podman/root.go | |
parent | 5829d62ea0c08e358eb287636673316080d51001 (diff) | |
download | podman-c6e4453f6223bbb2b6cfd5242c0d9af55cd8b121.tar.gz podman-c6e4453f6223bbb2b6cfd5242c0d9af55cd8b121.tar.bz2 podman-c6e4453f6223bbb2b6cfd5242c0d9af55cd8b121.zip |
If container exits with 125 podman should exit with 125
fixes: https://github.com/containers/podman/issues/11540
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'cmd/podman/root.go')
-rw-r--r-- | cmd/podman/root.go | 10 |
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()) } |