summaryrefslogtreecommitdiff
path: root/pkg/adapter/containers.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/adapter/containers.go')
-rw-r--r--pkg/adapter/containers.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/pkg/adapter/containers.go b/pkg/adapter/containers.go
index 47f1b091e..a8bff187c 100644
--- a/pkg/adapter/containers.go
+++ b/pkg/adapter/containers.go
@@ -1000,7 +1000,14 @@ func (r *LocalRuntime) ExecContainer(ctx context.Context, cli *cliconfig.ExecVal
streams.AttachOutput = true
streams.AttachError = true
- return ExecAttachCtr(ctx, ctr.Container, cli.Tty, cli.Privileged, envs, cmd, cli.User, cli.Workdir, streams, cli.PreserveFDs, cli.DetachKeys)
+ ec, err = ExecAttachCtr(ctx, ctr.Container, cli.Tty, cli.Privileged, envs, cmd, cli.User, cli.Workdir, streams, cli.PreserveFDs, cli.DetachKeys)
+ if errors.Cause(err) == define.ErrOCIRuntimePermissionDenied {
+ ec = 126
+ }
+ if errors.Cause(err) == define.ErrOCIRuntimeNotFound {
+ ec = 127
+ }
+ return ec, err
}
// Prune removes stopped containers