forked from TrueCloudLab/distribution
registry/storage: rename variables that collided with imports
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
030489ca66
commit
f2db7faa2f
1 changed files with 9 additions and 9 deletions
|
@ -33,8 +33,8 @@ type manifestStoreTestEnv struct {
|
||||||
|
|
||||||
func newManifestStoreTestEnv(t *testing.T, name reference.Named, tag string, options ...RegistryOption) *manifestStoreTestEnv {
|
func newManifestStoreTestEnv(t *testing.T, name reference.Named, tag string, options ...RegistryOption) *manifestStoreTestEnv {
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
driver := inmemory.New()
|
drvr := inmemory.New()
|
||||||
registry, err := NewRegistry(ctx, driver, options...)
|
registry, err := NewRegistry(ctx, drvr, options...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("error creating registry: %v", err)
|
t.Fatalf("error creating registry: %v", err)
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,7 @@ func newManifestStoreTestEnv(t *testing.T, name reference.Named, tag string, opt
|
||||||
|
|
||||||
return &manifestStoreTestEnv{
|
return &manifestStoreTestEnv{
|
||||||
ctx: ctx,
|
ctx: ctx,
|
||||||
driver: driver,
|
driver: drvr,
|
||||||
registry: registry,
|
registry: registry,
|
||||||
repository: repo,
|
repository: repo,
|
||||||
name: name,
|
name: name,
|
||||||
|
@ -434,25 +434,25 @@ func testOCIManifestStorage(t *testing.T, testname string, includeMediaTypes boo
|
||||||
builder.AppendReference(distribution.Descriptor{Digest: dgst})
|
builder.AppendReference(distribution.Descriptor{Digest: dgst})
|
||||||
}
|
}
|
||||||
|
|
||||||
manifest, err := builder.Build(ctx)
|
mfst, err := builder.Build(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("%s: unexpected error generating manifest: %v", testname, err)
|
t.Fatalf("%s: unexpected error generating manifest: %v", testname, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// before putting the manifest test for proper handling of SchemaVersion
|
// before putting the manifest test for proper handling of SchemaVersion
|
||||||
|
|
||||||
if manifest.(*ocischema.DeserializedManifest).Manifest.SchemaVersion != 2 {
|
if mfst.(*ocischema.DeserializedManifest).Manifest.SchemaVersion != 2 {
|
||||||
t.Fatalf("%s: unexpected error generating default version for oci manifest", testname)
|
t.Fatalf("%s: unexpected error generating default version for oci manifest", testname)
|
||||||
}
|
}
|
||||||
manifest.(*ocischema.DeserializedManifest).Manifest.SchemaVersion = 0
|
mfst.(*ocischema.DeserializedManifest).Manifest.SchemaVersion = 0
|
||||||
|
|
||||||
var manifestDigest digest.Digest
|
var manifestDigest digest.Digest
|
||||||
if manifestDigest, err = ms.Put(ctx, manifest); err != nil {
|
if manifestDigest, err = ms.Put(ctx, mfst); err != nil {
|
||||||
if err.Error() != "unrecognized manifest schema version 0" {
|
if err.Error() != "unrecognized manifest schema version 0" {
|
||||||
t.Fatalf("%s: unexpected error putting manifest: %v", testname, err)
|
t.Fatalf("%s: unexpected error putting manifest: %v", testname, err)
|
||||||
}
|
}
|
||||||
manifest.(*ocischema.DeserializedManifest).Manifest.SchemaVersion = 2
|
mfst.(*ocischema.DeserializedManifest).Manifest.SchemaVersion = 2
|
||||||
if manifestDigest, err = ms.Put(ctx, manifest); err != nil {
|
if manifestDigest, err = ms.Put(ctx, mfst); err != nil {
|
||||||
t.Fatalf("%s: unexpected error putting manifest: %v", testname, err)
|
t.Fatalf("%s: unexpected error putting manifest: %v", testname, err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue