From cf771137959253c7461275630c56a751fe24a231 Mon Sep 17 00:00:00 2001 From: Manish Tomar Date: Thu, 1 Nov 2018 18:24:16 -0700 Subject: [PATCH] add pathspec for repo _layers directory Signed-off-by: Guillaume Rose --- registry/storage/paths.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/registry/storage/paths.go b/registry/storage/paths.go index 2d1f5132f..16e71583a 100644 --- a/registry/storage/paths.go +++ b/registry/storage/paths.go @@ -87,6 +87,7 @@ const ( // Blobs: // // layerLinkPathSpec: /v2/repositories//_layers///link +// layersPathSpec: /v2/repositories//_layers // // Uploads: // @@ -206,6 +207,8 @@ func pathFor(spec pathSpec) (string, error) { blobLinkPathComponents := append(repoPrefix, v.name, "_layers") return path.Join(path.Join(append(blobLinkPathComponents, components...)...), "link"), nil + case layersPathSpec: + return append(repoPrefix, v.repo, "_layers") case blobsPathSpec: blobsPathPrefix := append(rootPrefix, "blobs") return path.Join(blobsPathPrefix...), nil @@ -335,6 +338,13 @@ type manifestTagIndexEntryLinkPathSpec struct { func (manifestTagIndexEntryLinkPathSpec) pathSpec() {} +// layersPathSpec contains the path for the layers inside a repo +type layersPathSpec struct { + repo string +} + +func (layersPathSpec) pathSpec() {} + // blobLinkPathSpec specifies a path for a blob link, which is a file with a // blob id. The blob link will contain a content addressable blob id reference // into the blob store. The format of the contents is as follows: