Merge pull request #5143 from kevpar/fix-lookpath

Fix error checking when resolving shim binary path
This commit is contained in:
Fu, Wei
2021-03-09 12:01:22 +08:00
committed by GitHub

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