diff options
author | Giuseppe Scrivano <gscrivan@redhat.com> | 2019-08-14 19:28:41 +0200 |
---|---|---|
committer | Giuseppe Scrivano <gscrivan@redhat.com> | 2019-08-19 11:11:35 +0200 |
commit | 763d2d062d47149ca67f69c6db58ee0b8d1e771f (patch) | |
tree | e91a7aa7b44f626e05cbc9d87a6959877edd6b56 | |
parent | 438cbf4c8960db0b59a25a3fb38a778e24a69a40 (diff) | |
download | podman-763d2d062d47149ca67f69c6db58ee0b8d1e771f.tar.gz podman-763d2d062d47149ca67f69c6db58ee0b8d1e771f.tar.bz2 podman-763d2d062d47149ca67f69c6db58ee0b8d1e771f.zip |
libpod: still attempt to read the oci log file if not output
if we didn't receive any data on the pipe, still attempt to read the
specified log file.
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
-rw-r--r-- | libpod/oci_internal_linux.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libpod/oci_internal_linux.go b/libpod/oci_internal_linux.go index 6e4ee2cf2..e7ed32272 100644 --- a/libpod/oci_internal_linux.go +++ b/libpod/oci_internal_linux.go @@ -449,6 +449,15 @@ func readConmonPipeData(pipe *os.File, ociLog string) (int, error) { select { case ss := <-ch: if ss.err != nil { + if ociLog != "" { + ociLogData, err := ioutil.ReadFile(ociLog) + if err == nil { + var ociErr ociError + if err := json.Unmarshal(ociLogData, &ociErr); err == nil { + return -1, getOCIRuntimeError(ociErr.Msg) + } + } + } return -1, errors.Wrapf(ss.err, "error reading container (probably exited) json message") } logrus.Debugf("Received: %d", ss.si.Data) |