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:
parent
8c3fc2619c
commit
6712e602b0
22 changed files with 120 additions and 106 deletions
|
@ -9,6 +9,7 @@ import (
|
|||
"github.com/docker/distribution/context"
|
||||
"github.com/docker/distribution/digest"
|
||||
"github.com/docker/distribution/manifest"
|
||||
"github.com/docker/distribution/manifest/schema1"
|
||||
"github.com/docker/distribution/registry/storage"
|
||||
"github.com/docker/distribution/registry/storage/cache/memory"
|
||||
"github.com/docker/distribution/registry/storage/driver/inmemory"
|
||||
|
@ -54,18 +55,18 @@ type testListener struct {
|
|||
ops map[string]int
|
||||
}
|
||||
|
||||
func (tl *testListener) ManifestPushed(repo string, sm *manifest.SignedManifest) error {
|
||||
func (tl *testListener) ManifestPushed(repo string, sm *schema1.SignedManifest) error {
|
||||
tl.ops["manifest:push"]++
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (tl *testListener) ManifestPulled(repo string, sm *manifest.SignedManifest) error {
|
||||
func (tl *testListener) ManifestPulled(repo string, sm *schema1.SignedManifest) error {
|
||||
tl.ops["manifest:pull"]++
|
||||
return nil
|
||||
}
|
||||
|
||||
func (tl *testListener) ManifestDeleted(repo string, sm *manifest.SignedManifest) error {
|
||||
func (tl *testListener) ManifestDeleted(repo string, sm *schema1.SignedManifest) error {
|
||||
tl.ops["manifest:delete"]++
|
||||
return nil
|
||||
}
|
||||
|
@ -94,7 +95,7 @@ func checkExerciseRepository(t *testing.T, repository distribution.Repository) {
|
|||
// update counts. Basically, it would make writing tests a lot easier.
|
||||
ctx := context.Background()
|
||||
tag := "thetag"
|
||||
m := manifest.Manifest{
|
||||
m := schema1.Manifest{
|
||||
Versioned: manifest.Versioned{
|
||||
SchemaVersion: 1,
|
||||
},
|
||||
|
@ -127,7 +128,7 @@ func checkExerciseRepository(t *testing.T, repository distribution.Repository) {
|
|||
t.Fatalf("unexpected error finishing upload: %v", err)
|
||||
}
|
||||
|
||||
m.FSLayers = append(m.FSLayers, manifest.FSLayer{
|
||||
m.FSLayers = append(m.FSLayers, schema1.FSLayer{
|
||||
BlobSum: dgst,
|
||||
})
|
||||
|
||||
|
@ -144,7 +145,7 @@ func checkExerciseRepository(t *testing.T, repository distribution.Repository) {
|
|||
t.Fatalf("unexpected error generating key: %v", err)
|
||||
}
|
||||
|
||||
sm, err := manifest.Sign(&m, pk)
|
||||
sm, err := schema1.Sign(&m, pk)
|
||||
if err != nil {
|
||||
t.Fatalf("unexpected error signing manifest: %v", err)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue