From ad11105052ce28c66aeb57d0a563be251309232d Mon Sep 17 00:00:00 2001 From: James Hewitt Date: Fri, 18 Aug 2023 13:52:19 +0100 Subject: [PATCH] Revert "removed redundant check" This reverts commit 0f846853feb903585d5733e7aa6b56d564b03e3d. Signed-off-by: James Hewitt --- registry/storage/catalog.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/registry/storage/catalog.go b/registry/storage/catalog.go index 09a687d8..754893f9 100644 --- a/registry/storage/catalog.go +++ b/registry/storage/catalog.go @@ -112,6 +112,14 @@ func (reg *registry) walkRepos(ctx context.Context, root, last string, fn func(r // walkReposPath walks through all folders in `lookPath`, // looking for repositories. See walkRepos for more detailed description. func (reg *registry) walkReposPath(ctx context.Context, root, lookPath, last string, fn func(repoPath string) error) error { + // ensure that the current path is a dir, otherwise we just return + if f, err := reg.blobStore.driver.Stat(ctx, lookPath); err != nil || !f.IsDir() { + if err != nil { + return err + } + return nil + } + // get children in the current path children, err := reg.blobStore.driver.List(ctx, lookPath) if err != nil {