From ba2130ff55d1410407d56c65d5592ee40d20fae2 Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Sun, 12 Sep 2021 08:51:53 -0400 Subject: If container exits with 125 podman should exit with 125 fixes: https://github.com/containers/podman/issues/11540 Signed-off-by: Daniel J Walsh --- cmd/podman/root.go | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'cmd/podman/root.go') 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()) } -- cgit v1.2.3-54-g00ecf