forked from TrueCloudLab/distribution
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 <awg@digitalocean.com>
This commit is contained in:
parent
1d0ea8ed7b
commit
a784441b62
1 changed files with 2 additions and 2 deletions
|
@ -143,8 +143,8 @@ func handleRepository(fileInfo driver.FileInfo, root, last string, fn func(repoP
|
||||||
repo := filePath[len(root)+1:]
|
repo := filePath[len(root)+1:]
|
||||||
|
|
||||||
_, file := path.Split(repo)
|
_, file := path.Split(repo)
|
||||||
if file == "_layers" {
|
if file == "_manifests" {
|
||||||
repo = strings.TrimSuffix(repo, "/_layers")
|
repo = strings.TrimSuffix(repo, "/_manifests")
|
||||||
if lessPath(last, repo) {
|
if lessPath(last, repo) {
|
||||||
if err := fn(repo); err != nil {
|
if err := fn(repo); err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Reference in a new issue