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 <kevpar@microsoft.com>
This commit is contained in:
Kevin Parsons 2021-03-08 16:24:19 -08:00
parent 6d68490ef6
commit c9afc4250a

View File

@ -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