diff --git a/registry/storage/blobstore.go b/registry/storage/blobstore.go index d8db5b417..1008aad8c 100644 --- a/registry/storage/blobstore.go +++ b/registry/storage/blobstore.go @@ -94,6 +94,11 @@ func (bs *blobStore) Enumerate(ctx context.Context, ingester func(dgst digest.Di } return bs.driver.Walk(ctx, specPath, func(fileInfo driver.FileInfo) error { + // skip directories + if fileInfo.IsDir() { + return nil + } + currentPath := fileInfo.Path() // we only want to parse paths that end with /data _, fileName := path.Split(currentPath) diff --git a/registry/storage/driver/azure/azure.go b/registry/storage/driver/azure/azure.go index f7866825c..58c6293b2 100644 --- a/registry/storage/driver/azure/azure.go +++ b/registry/storage/driver/azure/azure.go @@ -360,7 +360,7 @@ func (d *driver) URLFor(ctx context.Context, path string, options map[string]int } // Walk traverses a filesystem defined within driver, starting -// from the given path, calling f on each file and directory +// from the given path, calling f on each file func (d *driver) Walk(ctx context.Context, path string, f storagedriver.WalkFn) error { return storagedriver.WalkFallback(ctx, d, path, f) } diff --git a/registry/storage/driver/filesystem/driver.go b/registry/storage/driver/filesystem/driver.go index 73d379656..8fc9d1ca0 100644 --- a/registry/storage/driver/filesystem/driver.go +++ b/registry/storage/driver/filesystem/driver.go @@ -290,7 +290,7 @@ func (d *driver) URLFor(ctx context.Context, path string, options map[string]int } // Walk traverses a filesystem defined within driver, starting -// from the given path, calling f on each file and directory +// from the given path, calling f on each file func (d *driver) Walk(ctx context.Context, path string, f storagedriver.WalkFn) error { return storagedriver.WalkFallback(ctx, d, path, f) } diff --git a/registry/storage/driver/inmemory/driver.go b/registry/storage/driver/inmemory/driver.go index b875ebe48..4b1f5f48d 100644 --- a/registry/storage/driver/inmemory/driver.go +++ b/registry/storage/driver/inmemory/driver.go @@ -245,7 +245,7 @@ func (d *driver) URLFor(ctx context.Context, path string, options map[string]int } // Walk traverses a filesystem defined within driver, starting -// from the given path, calling f on each file and directory +// from the given path, calling f on each file func (d *driver) Walk(ctx context.Context, path string, f storagedriver.WalkFn) error { return storagedriver.WalkFallback(ctx, d, path, f) } diff --git a/registry/storage/driver/swift/swift.go b/registry/storage/driver/swift/swift.go index 89ae69af4..b64e3b66c 100644 --- a/registry/storage/driver/swift/swift.go +++ b/registry/storage/driver/swift/swift.go @@ -658,7 +658,7 @@ func (d *driver) URLFor(ctx context.Context, path string, options map[string]int } // Walk traverses a filesystem defined within driver, starting -// from the given path, calling f on each file and directory +// from the given path, calling f on each file func (d *driver) Walk(ctx context.Context, path string, f storagedriver.WalkFn) error { return storagedriver.WalkFallback(ctx, d, path, f) } diff --git a/registry/storage/linkedblobstore.go b/registry/storage/linkedblobstore.go index 7f6ed18e1..3e3fffe19 100644 --- a/registry/storage/linkedblobstore.go +++ b/registry/storage/linkedblobstore.go @@ -248,6 +248,10 @@ func (lbs *linkedBlobStore) Enumerate(ctx context.Context, ingestor func(digest. return err } return lbs.driver.Walk(ctx, rootPath, func(fileInfo driver.FileInfo) error { + // exit early if directory... + if fileInfo.IsDir() { + return nil + } filePath := fileInfo.Path() // check if it's a link