summaryrefslogtreecommitdiff
path: root/pkg/adapter/containers.go
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2019-08-14 19:05:05 +0200
committerGiuseppe Scrivano <gscrivan@redhat.com>2019-08-19 11:11:37 +0200
commit74211249196bdb1e86a9a0b2283bc4a390dc3161 (patch)
tree0ff1bbc93945eebd1e09b29d19ff481e3f952f33 /pkg/adapter/containers.go
parentf8cd1d49f7a1004ccdeefe6a2da21d9f46d38f58 (diff)
downloadpodman-74211249196bdb1e86a9a0b2283bc4a390dc3161.tar.gz
podman-74211249196bdb1e86a9a0b2283bc4a390dc3161.tar.bz2
podman-74211249196bdb1e86a9a0b2283bc4a390dc3161.zip
libpod, pkg: lookup also for crun failures
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'pkg/adapter/containers.go')
-rw-r--r--pkg/adapter/containers.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/pkg/adapter/containers.go b/pkg/adapter/containers.go
index 8a4376486..863640f97 100644
--- a/pkg/adapter/containers.go
+++ b/pkg/adapter/containers.go
@@ -342,7 +342,8 @@ func (r *LocalRuntime) Run(ctx context.Context, c *cliconfig.RunValues, exitCode
if err := ctr.Start(ctx, c.IsSet("pod")); err != nil {
// This means the command did not exist
exitCode = 127
- if strings.Contains(err.Error(), "permission denied") || strings.Contains(err.Error(), "file not found") {
+ e := strings.ToLower(err.Error())
+ if strings.Contains(e, "permission denied") || strings.Contains(e, "operation not permitted") || strings.Contains(e, "file not found") || strings.Contains(e, "no such file or directory") {
exitCode = 126
}
return exitCode, err
@@ -405,7 +406,8 @@ func (r *LocalRuntime) Run(ctx context.Context, c *cliconfig.RunValues, exitCode
}
// This means the command did not exist
exitCode = 127
- if strings.Contains(err.Error(), "permission denied") {
+ e := strings.ToLower(err.Error())
+ if strings.Contains(e, "permission denied") || strings.Contains(e, "operation not permitted") {
exitCode = 126
}
if c.IsSet("rm") {