mirror of
https://github.com/distribution/distribution.git
synced 2025-09-10 19:29:33 +00:00
Update registry to use WithName for creating Named values
The registry uses partial Named values which the named parsers no longer support. To allow the registry service to continue to operate without canonicalization, switch to use WithName. In the future, the registry should start using fully canonical values on the backend and WithName should no longer support creating partial values. Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
This commit is contained in:
@@ -16,7 +16,7 @@ import (
|
||||
)
|
||||
|
||||
func TestLinkedBlobStoreCreateWithMountFrom(t *testing.T) {
|
||||
fooRepoName, _ := reference.ParseNamed("nm/foo")
|
||||
fooRepoName, _ := reference.WithName("nm/foo")
|
||||
fooEnv := newManifestStoreTestEnv(t, fooRepoName, "thetag")
|
||||
ctx := context.Background()
|
||||
stats, err := mockRegistry(t, fooEnv.registry)
|
||||
@@ -54,7 +54,7 @@ func TestLinkedBlobStoreCreateWithMountFrom(t *testing.T) {
|
||||
}
|
||||
|
||||
// create another repository nm/bar
|
||||
barRepoName, _ := reference.ParseNamed("nm/bar")
|
||||
barRepoName, _ := reference.WithName("nm/bar")
|
||||
barRepo, err := fooEnv.registry.Repository(ctx, barRepoName)
|
||||
if err != nil {
|
||||
t.Fatalf("unexpected error getting repo: %v", err)
|
||||
@@ -94,7 +94,7 @@ func TestLinkedBlobStoreCreateWithMountFrom(t *testing.T) {
|
||||
clearStats(stats)
|
||||
|
||||
// create yet another repository nm/baz
|
||||
bazRepoName, _ := reference.ParseNamed("nm/baz")
|
||||
bazRepoName, _ := reference.WithName("nm/baz")
|
||||
bazRepo, err := fooEnv.registry.Repository(ctx, bazRepoName)
|
||||
if err != nil {
|
||||
t.Fatalf("unexpected error getting repo: %v", err)
|
||||
|
Reference in New Issue
Block a user