From a784441b6222bcf5e66feb0062d135dcc72dc9ee Mon Sep 17 00:00:00 2001 From: Adam Wolfe Gordon Date: Thu, 28 May 2020 13:42:43 -0600 Subject: [PATCH] catalog: List repositories with no unique layers A repository need not contain any unique layers, if its images use only layers mounted from other repositories. But, the catalog endpoint was looking for the _layers directory to indicate that a directory was a repository. Use the _manifests directory as the marker instead, since any repository with revisions will contain a _manifests directory. Signed-off-by: Adam Wolfe Gordon --- registry/storage/catalog.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/registry/storage/catalog.go b/registry/storage/catalog.go index ebf80e05b..a903fb393 100644 --- a/registry/storage/catalog.go +++ b/registry/storage/catalog.go @@ -143,8 +143,8 @@ func handleRepository(fileInfo driver.FileInfo, root, last string, fn func(repoP repo := filePath[len(root)+1:] _, file := path.Split(repo) - if file == "_layers" { - repo = strings.TrimSuffix(repo, "/_layers") + if file == "_manifests" { + repo = strings.TrimSuffix(repo, "/_manifests") if lessPath(last, repo) { if err := fn(repo); err != nil { return err