mirror of https://github.com/containers/podman.git
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 <pehunt@redhat.com>
This commit is contained in:
parent
797da2a57b
commit
4632b81c81
|
@ -340,6 +340,12 @@ func (c *Container) Exec(tty, privileged bool, env map[string]string, cmd []stri
|
||||||
if lastErr != nil {
|
if lastErr != nil {
|
||||||
logrus.Errorf(lastErr.Error())
|
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)
|
lastErr = errors.Wrapf(define.ErrOCIRuntime, "non zero exit code: %d", exitCodeData.data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue