diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-03-24 18:52:44 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-24 18:52:44 +0100 |
commit | cd10432b0966698a344ca226844d35ac945154ed (patch) | |
tree | c8ae9980a00c16cf0397aed298043a1ab3e240b8 /libpod | |
parent | 3b1d7a7d2450b72853233a635944ceebc9a89262 (diff) | |
parent | 7ae52e86ffbd3851769f02db503332c9c8e84e4e (diff) | |
download | podman-cd10432b0966698a344ca226844d35ac945154ed.tar.gz podman-cd10432b0966698a344ca226844d35ac945154ed.tar.bz2 podman-cd10432b0966698a344ca226844d35ac945154ed.zip |
Merge pull request #13637 from Luap99/conmon-err
readConmonPipeData: try to improve error
Diffstat (limited to 'libpod')
-rw-r--r-- | libpod/oci_conmon_linux.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libpod/oci_conmon_linux.go b/libpod/oci_conmon_linux.go index ba4079bed..38bf85834 100644 --- a/libpod/oci_conmon_linux.go +++ b/libpod/oci_conmon_linux.go @@ -1587,11 +1587,13 @@ func readConmonPipeData(runtimeName string, pipe *os.File, ociLog string) (int, var si *syncInfo rdr := bufio.NewReader(pipe) b, err := rdr.ReadBytes('\n') - if err != nil { + // ignore EOF here, error is returned even when data was read + // if it is no valid json unmarshal will fail below + if err != nil && !errors.Is(err, io.EOF) { ch <- syncStruct{err: err} } if err := json.Unmarshal(b, &si); err != nil { - ch <- syncStruct{err: err} + ch <- syncStruct{err: fmt.Errorf("conmon bytes %q: %w", string(b), err)} return } ch <- syncStruct{si: si} |