Merge pull request #3143 from eyJhb/pagination

OCI: Add pagination on `/v2/<name>/tags/list`
This commit is contained in:
João Pereira
2021-05-22 15:05:18 +01:00
committed by GitHub
5 changed files with 75 additions and 0 deletions

View File

@@ -3,6 +3,7 @@ package storage
import (
"context"
"path"
"sort"
"github.com/distribution/distribution/v3"
storagedriver "github.com/distribution/distribution/v3/registry/storage/driver"
@@ -47,6 +48,10 @@ func (ts *tagStore) All(ctx context.Context) ([]string, error) {
tags = append(tags, filename)
}
// there is no guarantee for the order,
// therefore sort before return.
sort.Strings(tags)
return tags, nil
}