From 4632b81c81a73025a960e339f40bc805f8a6c70a Mon Sep 17 00:00:00 2001 From: Peter Hunt Date: Wed, 4 Mar 2020 16:21:01 -0500 Subject: exec: fix error code when conmon fails this is a cosmetic change that makes sure podman returns a sane error code when conmon dies underneath it Signed-off-by: Peter Hunt --- libpod/container_api.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libpod/container_api.go b/libpod/container_api.go index 356da12d0..dc7470f1a 100644 --- a/libpod/container_api.go +++ b/libpod/container_api.go @@ -340,6 +340,12 @@ func (c *Container) Exec(tty, privileged bool, env map[string]string, cmd []stri if lastErr != nil { logrus.Errorf(lastErr.Error()) } + // ErrorConmonRead is a bogus value set by podman to indicate reading a value from + // conmon failed. Since it is specifically not a valid exit code, we should set + // a generic error here + if exitCodeData.data == define.ErrorConmonRead { + exitCodeData.data = define.ExecErrorCodeGeneric + } lastErr = errors.Wrapf(define.ErrOCIRuntime, "non zero exit code: %d", exitCodeData.data) } -- cgit v1.2.3-54-g00ecf