From 12b03bcb2757ac0dc9a92852d43293b96e68f3de Mon Sep 17 00:00:00 2001 From: Brian Goff Date: Wed, 14 Apr 2021 23:03:18 +0000 Subject: [PATCH] Error string match: do not match command path Whether or not the command path is in the error message is a an implementation detail. For example, on Windows the only reason this ever matched was because it dumped the entire container config into the error message, but this had nothing to do with the actual error. Signed-off-by: Brian Goff (cherry picked from commit 225e046d9d1bdf0f06f4c97bef239b5909463885) Signed-off-by: Brian Goff --- daemon/errors.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/daemon/errors.go b/daemon/errors.go index aae0954ae5..6f9eb54039 100644 --- a/daemon/errors.go +++ b/daemon/errors.go @@ -141,11 +141,10 @@ func translateContainerdStartErr(cmd string, setExitCode func(int), err error) e // if we receive an internal error from the initial start of a container then lets // return it instead of entering the restart loop // set to 127 for container cmd not found/does not exist) - if contains(errDesc, cmd) && - (contains(errDesc, "executable file not found") || - contains(errDesc, "no such file or directory") || - contains(errDesc, "system cannot find the file specified") || - contains(errDesc, "failed to run runc create/exec call")) { + if contains(errDesc, "executable file not found") || + contains(errDesc, "no such file or directory") || + contains(errDesc, "system cannot find the file specified") || + contains(errDesc, "failed to run runc create/exec call") { setExitCode(127) retErr = startInvalidConfigError(errDesc) }