mirror of
https://github.com/podman-container-tools/podman.git
synced 2026-08-31 04:37:50 +00:00
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>
This commit is contained in:
parent
438cbf4c89
commit
763d2d062d
1 changed files with 9 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue