vendor: update moby/buildkit

Update modules:

  go mod edit -require github.com/moby/buildkit@master
  go mod tidy -compat=1.17 && ./hack/update-vendor

Signed-off-by: Justin Chadwell <me@jedevc.com>
This commit is contained in:
Justin Chadwell
2022-05-17 16:11:41 +01:00
parent 66a764f9c1
commit 22ac3271d2
113 changed files with 2667 additions and 662 deletions

View File

@ -19,9 +19,29 @@ type WalkOpt struct {
// FollowPaths contains symlinks that are resolved into include patterns
// before performing the fs walk
FollowPaths []string
Map FilterFunc
Map MapFunc
}
type MapFunc func(string, *types.Stat) MapResult
// The result of the walk function controls
// both how WalkDir continues and whether the path is kept.
type MapResult int
const (
// Keep the current path and continue.
MapResultKeep MapResult = iota
// Exclude the current path and continue.
MapResultExclude
// Exclude the current path, and skip the rest of the dir.
// If path is a dir, skip the current directory.
// If path is a file, skip the rest of the parent directory.
// (This matches the semantics of fs.SkipDir.)
MapResultSkipDir
)
func Walk(ctx context.Context, p string, opt *WalkOpt, fn filepath.WalkFunc) error {
root, err := filepath.EvalSymlinks(p)
if err != nil {
@ -258,7 +278,10 @@ func Walk(ctx context.Context, p string, opt *WalkOpt, fn filepath.WalkFunc) err
return ctx.Err()
default:
if opt != nil && opt.Map != nil {
if allowed := opt.Map(stat.Path, stat); !allowed {
result := opt.Map(stat.Path, stat)
if result == MapResultSkipDir {
return filepath.SkipDir
} else if result == MapResultExclude {
return nil
}
}
@ -277,7 +300,8 @@ func Walk(ctx context.Context, p string, opt *WalkOpt, fn filepath.WalkFunc) err
default:
}
if opt != nil && opt.Map != nil {
if allowed := opt.Map(parentStat.Path, parentStat); !allowed {
result := opt.Map(parentStat.Path, parentStat)
if result == MapResultSkipDir || result == MapResultExclude {
continue
}
}