containers: look also for 'file not found' in the error message

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
Giuseppe Scrivano 2019-08-12 15:47:26 +02:00
parent 2f8451468c
commit efa26eedee
No known key found for this signature in database
GPG key ID: E4730F97F60286ED

View file

@ -342,7 +342,7 @@ 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") {
if strings.Contains(err.Error(), "permission denied") || strings.Contains(err.Error(), "file not found") {
exitCode = 126
}
return exitCode, err