summaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-08-19 16:42:19 +0200
committerGitHub <noreply@github.com>2019-08-19 16:42:19 +0200
commitb1acc4348184d43def7c63221ee0832505c4b7d1 (patch)
tree8c04b5ce2c82ef50f45d8618ae4874d972abc285 /libpod
parent25f2b9ae984c00d339e7a80eeb487b1f00bd4f7d (diff)
parentf7527fb06da688613c6ce6383664ce5eb48267eb (diff)
downloadpodman-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')
-rw-r--r--libpod/oci_internal_linux.go14
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"))