diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-08-19 16:42:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-19 16:42:19 +0200 |
commit | b1acc4348184d43def7c63221ee0832505c4b7d1 (patch) | |
tree | 8c04b5ce2c82ef50f45d8618ae4874d972abc285 /libpod/oci_internal_linux.go | |
parent | 25f2b9ae984c00d339e7a80eeb487b1f00bd4f7d (diff) | |
parent | f7527fb06da688613c6ce6383664ce5eb48267eb (diff) | |
download | podman-b1acc4348184d43def7c63221ee0832505c4b7d1.tar.gz podman-b1acc4348184d43def7c63221ee0832505c4b7d1.tar.bz2 podman-b1acc4348184d43def7c63221ee0832505c4b7d1.zip |
Merge pull request #3848 from giuseppe/enable-all-tests-crun
tests: enable all tests for crun
Diffstat (limited to 'libpod/oci_internal_linux.go')
-rw-r--r-- | libpod/oci_internal_linux.go | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/libpod/oci_internal_linux.go b/libpod/oci_internal_linux.go index 6e4ee2cf2..607d5c14f 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) @@ -476,10 +485,11 @@ func readConmonPipeData(pipe *os.File, ociLog string) (int, error) { } func getOCIRuntimeError(runtimeMsg string) error { - if match, _ := regexp.MatchString(".*permission denied.*", runtimeMsg); match { + r := strings.ToLower(runtimeMsg) + if match, _ := regexp.MatchString(".*permission denied.*|.*operation not permitted.*", r); match { return errors.Wrapf(define.ErrOCIRuntimePermissionDenied, "%s", strings.Trim(runtimeMsg, "\n")) } - if match, _ := regexp.MatchString(".*executable file not found in.*", runtimeMsg); match { + if match, _ := regexp.MatchString(".*executable file not found in.*|.*no such file or directory.*", r); match { return errors.Wrapf(define.ErrOCIRuntimeNotFound, "%s", strings.Trim(runtimeMsg, "\n")) } return errors.Wrapf(define.ErrOCIRuntime, "%s", strings.Trim(runtimeMsg, "\n")) |