registry/storage: rename variables that collided with imports

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2022-11-26 14:11:08 +01:00
parent 030489ca66
commit f2db7faa2f
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C

View file

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