From c9afc4250ab183f9e944297c15df705851b3ec42 Mon Sep 17 00:00:00 2001 From: Kevin Parsons Date: Mon, 8 Mar 2021 16:24:19 -0800 Subject: [PATCH] Fix error checking when resolving shim binary path Previously a typo was introduced that caused the wrong error to be checked against when calling exec.LookPath. This had the effect that containerd would never locate the shim binary if it was in the same directory as containerd's binary, but not in PATH. Signed-off-by: Kevin Parsons --- runtime/v2/shim/util.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/v2/shim/util.go b/runtime/v2/shim/util.go index 59f9ff21c..52bfaa9ce 100644 --- a/runtime/v2/shim/util.go +++ b/runtime/v2/shim/util.go @@ -70,7 +70,7 @@ func Command(ctx context.Context, runtime, containerdAddress, containerdTTRPCAdd } if cmdPath == "" { - if cmdPath, lerr = exec.LookPath(name); err != nil { + if cmdPath, lerr = exec.LookPath(name); lerr != nil { if eerr, ok := lerr.(*exec.Error); ok { if eerr.Err == exec.ErrNotFound { // LookPath only finds current directory matches based on