Browse code

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 <cpuguy83@gmail.com>
(cherry picked from commit 225e046d9d1bdf0f06f4c97bef239b5909463885)
Signed-off-by: Brian Goff <cpuguy83@gmail.com>

Brian Goff authored on 2021/04/15 08:03:18
Showing 1 changed files
... ...
@@ -141,11 +141,10 @@ func translateContainerdStartErr(cmd string, setExitCode func(int), err error) e
141 141
 	// if we receive an internal error from the initial start of a container then lets
142 142
 	// return it instead of entering the restart loop
143 143
 	// set to 127 for container cmd not found/does not exist)
144
-	if contains(errDesc, cmd) &&
145
-		(contains(errDesc, "executable file not found") ||
146
-			contains(errDesc, "no such file or directory") ||
147
-			contains(errDesc, "system cannot find the file specified") ||
148
-			contains(errDesc, "failed to run runc create/exec call")) {
144
+	if contains(errDesc, "executable file not found") ||
145
+		contains(errDesc, "no such file or directory") ||
146
+		contains(errDesc, "system cannot find the file specified") ||
147
+		contains(errDesc, "failed to run runc create/exec call") {
149 148
 		setExitCode(127)
150 149
 		retErr = startInvalidConfigError(errDesc)
151 150
 	}