Fix bug in shim path lookup

Signed-off-by: Justin Terry (VM) <juterry@microsoft.com>
This commit is contained in:
Justin Terry (VM) 2019-01-28 14:04:14 -08:00
parent f35c3527b2
commit 6ed293ba94

View File

@ -71,9 +71,9 @@ func Command(ctx context.Context, runtime, containerdAddress, path string, cmdAr
// execute the shim found there.
testPath := filepath.Join(filepath.Dir(self), name)
if _, serr := os.Stat(testPath); serr == nil {
path = testPath
cmdPath = testPath
}
if path == "" {
if cmdPath == "" {
return nil, errors.Wrapf(os.ErrNotExist, "runtime %q binary not installed %q", runtime, name)
}
}