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
commit a5d17eb507
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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