diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2018-10-23 11:56:02 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-23 11:56:02 -0700 |
commit | 10bab99ea01006c4ca0048e6177d753f0732add7 (patch) | |
tree | cffc3566b999b9a9daec9e24333266d0643f8f66 | |
parent | d043ac4de52d1bab07aca98487792e6b4d3d4689 (diff) | |
parent | 318e33ce2cf1a0bea6b32894b8c3ac768dfb1200 (diff) | |
download | podman-10bab99ea01006c4ca0048e6177d753f0732add7.tar.gz podman-10bab99ea01006c4ca0048e6177d753f0732add7.tar.bz2 podman-10bab99ea01006c4ca0048e6177d753f0732add7.zip |
Merge pull request #1705 from baude/twostepjson
read conmon output and convert to json in two steps
-rw-r--r-- | libpod/oci.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libpod/oci.go b/libpod/oci.go index 2257cd42f..ca8f967c4 100644 --- a/libpod/oci.go +++ b/libpod/oci.go @@ -1,6 +1,7 @@ package libpod import ( + "bufio" "bytes" "encoding/json" "fmt" @@ -418,7 +419,12 @@ func (r *OCIRuntime) createOCIContainer(ctr *Container, cgroupParent string, res ch := make(chan syncStruct) go func() { var si *syncInfo - if err = json.NewDecoder(parentPipe).Decode(&si); err != nil { + rdr := bufio.NewReader(parentPipe) + b, err := rdr.ReadBytes('\n') + if err != nil { + ch <- syncStruct{err: err} + } + if err := json.Unmarshal(b, &si); err != nil { ch <- syncStruct{err: err} return } |