diff --git a/vendor.conf b/vendor.conf index ba9a01ed..a64c40ed 100644 --- a/vendor.conf +++ b/vendor.conf @@ -40,7 +40,7 @@ golang.org/x/time f51c12702a4d776e4c1fa9b0fabab841babae631 github.com/docker/docker 71cd53e4a197b303c6ba086bd584ffd67a884281 github.com/pkg/profile 5b67d428864e92711fcbd2f8629456121a56d91f -github.com/tonistiigi/fsutil f567071bed2416e4d87d260d3162722651182317 +github.com/tonistiigi/fsutil 2862f6bc5ac9b97124e552a5c108230b38a1b0ca github.com/hashicorp/go-immutable-radix 826af9ccf0feeee615d546d69b11f8e98da8c8f1 git://github.com/tonistiigi/go-immutable-radix.git github.com/hashicorp/golang-lru a0d98a5f288019575c6d1f4bb1573fef2d1fcdc4 github.com/mitchellh/hashstructure 2bca23e0e452137f789efbc8610126fd8b94f73b diff --git a/vendor/github.com/tonistiigi/fsutil/walker.go b/vendor/github.com/tonistiigi/fsutil/walker.go index 39e6c940..d78340df 100644 --- a/vendor/github.com/tonistiigi/fsutil/walker.go +++ b/vendor/github.com/tonistiigi/fsutil/walker.go @@ -5,6 +5,7 @@ import ( "os" "path/filepath" "strings" + "syscall" "time" "github.com/docker/docker/pkg/fileutils" @@ -71,7 +72,7 @@ func Walk(ctx context.Context, p string, opt *WalkOpt, fn filepath.WalkFunc) err return err } defer func() { - if retErr != nil && os.IsNotExist(errors.Cause(retErr)) { + if retErr != nil && isNotExist(retErr) { retErr = filepath.SkipDir } }() @@ -216,3 +217,14 @@ func trimUntilIndex(str, sep string, count int) string { } } } + +func isNotExist(err error) bool { + err = errors.Cause(err) + if os.IsNotExist(err) { + return true + } + if pe, ok := err.(*os.PathError); ok { + err = pe.Err + } + return err == syscall.ENOTDIR +}