Decouple storage components by redefining dependencies as interfaces instead of concrete types

Signed-off-by: Richard Scothern <richard.scothern@docker.com>
This commit is contained in:
Richard Scothern
2016-07-20 15:09:11 -07:00
parent 4e17ab5d31
commit 2a5fcacdf0
4 changed files with 15 additions and 27 deletions

View File

@@ -12,8 +12,8 @@ import (
// manifestListHandler is a ManifestHandler that covers schema2 manifest lists.
type manifestListHandler struct {
repository *repository
blobStore *linkedBlobStore
repository distribution.Repository
blobStore distribution.BlobStore
ctx context.Context
}
@@ -53,11 +53,6 @@ func (ms *manifestListHandler) Put(ctx context.Context, manifestList distributio
return "", err
}
// Link the revision into the repository.
if err := ms.blobStore.linkBlob(ctx, revision); err != nil {
return "", err
}
return revision.Digest, nil
}
@@ -72,6 +67,7 @@ func (ms *manifestListHandler) verifyManifest(ctx context.Context, mnfst manifes
// This manifest service is different from the blob service
// returned by Blob. It uses a linked blob store to ensure that
// only manifests are accessible.
manifestService, err := ms.repository.Manifests(ctx)
if err != nil {
return err