Move manifest package to schema1

As we begin our march towards multi-arch, we must prepare for the reality of
multiple manifest schemas. This is the beginning of a set of changes to
facilitate this. We are both moving this package into its target position where
it may live peacefully next to other manfiest versions.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
This commit is contained in:
Stephen J Day 2015-08-20 21:24:30 -07:00
parent 8c3fc2619c
commit 6712e602b0
22 changed files with 120 additions and 106 deletions

View file

@ -7,18 +7,18 @@ import (
"github.com/docker/distribution"
"github.com/docker/distribution/context"
"github.com/docker/distribution/digest"
"github.com/docker/distribution/manifest"
"github.com/docker/distribution/manifest/schema1"
)
// ManifestListener describes a set of methods for listening to events related to manifests.
type ManifestListener interface {
ManifestPushed(repo string, sm *manifest.SignedManifest) error
ManifestPulled(repo string, sm *manifest.SignedManifest) error
ManifestPushed(repo string, sm *schema1.SignedManifest) error
ManifestPulled(repo string, sm *schema1.SignedManifest) error
// TODO(stevvooe): Please note that delete support is still a little shaky
// and we'll need to propagate these in the future.
ManifestDeleted(repo string, sm *manifest.SignedManifest) error
ManifestDeleted(repo string, sm *schema1.SignedManifest) error
}
// BlobListener describes a listener that can respond to layer related events.
@ -74,7 +74,7 @@ type manifestServiceListener struct {
parent *repositoryListener
}
func (msl *manifestServiceListener) Get(dgst digest.Digest) (*manifest.SignedManifest, error) {
func (msl *manifestServiceListener) Get(dgst digest.Digest) (*schema1.SignedManifest, error) {
sm, err := msl.ManifestService.Get(dgst)
if err == nil {
if err := msl.parent.listener.ManifestPulled(msl.parent.Repository.Name(), sm); err != nil {
@ -85,7 +85,7 @@ func (msl *manifestServiceListener) Get(dgst digest.Digest) (*manifest.SignedMan
return sm, err
}
func (msl *manifestServiceListener) Put(sm *manifest.SignedManifest) error {
func (msl *manifestServiceListener) Put(sm *schema1.SignedManifest) error {
err := msl.ManifestService.Put(sm)
if err == nil {
@ -97,7 +97,7 @@ func (msl *manifestServiceListener) Put(sm *manifest.SignedManifest) error {
return err
}
func (msl *manifestServiceListener) GetByTag(tag string, options ...distribution.ManifestServiceOption) (*manifest.SignedManifest, error) {
func (msl *manifestServiceListener) GetByTag(tag string, options ...distribution.ManifestServiceOption) (*schema1.SignedManifest, error) {
sm, err := msl.ManifestService.GetByTag(tag, options...)
if err == nil {
if err := msl.parent.listener.ManifestPulled(msl.parent.Repository.Name(), sm); err != nil {