fixes to make layersPathSpec work

Signed-off-by: Guillaume Rose <guillaume.rose@docker.com>
This commit is contained in:
Manish Tomar 2018-11-01 18:35:32 -07:00 committed by Guillaume Rose
parent fa7d949408
commit 5538da4923
2 changed files with 3 additions and 3 deletions

View file

@ -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() {}

View file

@ -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,
}