From 5538da49234f2dbdcf2495a90ea55006508a4b70 Mon Sep 17 00:00:00 2001 From: Manish Tomar Date: Thu, 1 Nov 2018 18:35:32 -0700 Subject: [PATCH] fixes to make layersPathSpec work Signed-off-by: Guillaume Rose --- registry/storage/paths.go | 4 ++-- registry/storage/registry.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/registry/storage/paths.go b/registry/storage/paths.go index 16e71583a..4e9ad0856 100644 --- a/registry/storage/paths.go +++ b/registry/storage/paths.go @@ -208,7 +208,7 @@ func pathFor(spec pathSpec) (string, error) { return path.Join(path.Join(append(blobLinkPathComponents, components...)...), "link"), nil case layersPathSpec: - return append(repoPrefix, v.repo, "_layers") + return path.Join(append(repoPrefix, v.name, "_layers")...), nil case blobsPathSpec: blobsPathPrefix := append(rootPrefix, "blobs") return path.Join(blobsPathPrefix...), nil @@ -340,7 +340,7 @@ func (manifestTagIndexEntryLinkPathSpec) pathSpec() {} // layersPathSpec contains the path for the layers inside a repo type layersPathSpec struct { - repo string + name string } func (layersPathSpec) pathSpec() {} diff --git a/registry/storage/registry.go b/registry/storage/registry.go index 4809f153a..d74403f50 100644 --- a/registry/storage/registry.go +++ b/registry/storage/registry.go @@ -330,7 +330,7 @@ func (repo *repository) Blobs(ctx context.Context) distribution.BlobStore { // TODO(stevvooe): linkPath limits this blob store to only layers. // This instance cannot be used for manifest checks. linkPathFns: []linkPathFunc{blobLinkPath}, - linkDirectoryPathSpec: layersPathSpec, + linkDirectoryPathSpec: layersPathSpec{name: repo.name.Name()}, deleteEnabled: repo.registry.deleteEnabled, resumableDigestEnabled: repo.resumableDigestEnabled, }