From c83e9ae10af5586f88739e7de68779eb674dfc9a Mon Sep 17 00:00:00 2001 From: Collin Shoop Date: Thu, 24 Jun 2021 14:48:20 -0400 Subject: [PATCH] Replaced usage of storagedriver.Walk with storagedriver.WalkFiles for linked/blobstore --- registry/storage/blobstore.go | 7 +------ registry/storage/linkedblobstore.go | 6 +----- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/registry/storage/blobstore.go b/registry/storage/blobstore.go index 1008aad8c..ee7a03f0c 100644 --- a/registry/storage/blobstore.go +++ b/registry/storage/blobstore.go @@ -93,12 +93,7 @@ func (bs *blobStore) Enumerate(ctx context.Context, ingester func(dgst digest.Di return err } - return bs.driver.Walk(ctx, specPath, func(fileInfo driver.FileInfo) error { - // skip directories - if fileInfo.IsDir() { - return nil - } - + return bs.driver.WalkFiles(ctx, specPath, func(fileInfo driver.FileInfo) error { currentPath := fileInfo.Path() // we only want to parse paths that end with /data _, fileName := path.Split(currentPath) diff --git a/registry/storage/linkedblobstore.go b/registry/storage/linkedblobstore.go index 3e3fffe19..55992d00d 100644 --- a/registry/storage/linkedblobstore.go +++ b/registry/storage/linkedblobstore.go @@ -247,11 +247,7 @@ func (lbs *linkedBlobStore) Enumerate(ctx context.Context, ingestor func(digest. if err != nil { return err } - return lbs.driver.Walk(ctx, rootPath, func(fileInfo driver.FileInfo) error { - // exit early if directory... - if fileInfo.IsDir() { - return nil - } + return lbs.driver.WalkFiles(ctx, rootPath, func(fileInfo driver.FileInfo) error { filePath := fileInfo.Path() // check if it's a link