diff --git a/docker/daemon/daemon_dest.go b/docker/daemon/daemon_dest.go index a18c0a6e..2707167e 100644 --- a/docker/daemon/daemon_dest.go +++ b/docker/daemon/daemon_dest.go @@ -230,7 +230,7 @@ func (d *daemonImageDestination) PutManifest(m []byte) error { // a hostname-qualified reference. // See https://github.com/containers/image/issues/72 for a more detailed // analysis and explanation. - refString := fmt.Sprintf("%s:%s", d.namedTaggedRef.XFullName(), d.namedTaggedRef.XTag()) + refString := fmt.Sprintf("%s:%s", d.namedTaggedRef.Name(), d.namedTaggedRef.XTag()) items := []manifestItem{{ Config: man.Config.Digest.String(), diff --git a/docker/docker_image.go b/docker/docker_image.go index 98137e9f..f96f5617 100644 --- a/docker/docker_image.go +++ b/docker/docker_image.go @@ -34,7 +34,7 @@ func newImage(ctx *types.SystemContext, ref dockerReference) (types.Image, error // SourceRefFullName returns a fully expanded name for the repository this image is in. func (i *Image) SourceRefFullName() string { - return i.src.ref.ref.XFullName() + return i.src.ref.ref.Name() } // GetRepositoryTags list all tags available in the repository. Note that this has no connection with the tag(s) used for this specific image, if any. diff --git a/docker/lookaside.go b/docker/lookaside.go index 0b4334db..0b3d4a3c 100644 --- a/docker/lookaside.go +++ b/docker/lookaside.go @@ -64,7 +64,7 @@ func configuredSignatureStorageBase(ctx *types.SystemContext, ref dockerReferenc return nil, errors.Wrapf(err, "Invalid signature storage URL %s", topLevel) } // FIXME? Restrict to explicitly supported schemes? - repo := ref.ref.XFullName() // Note that this is without a tag or digest. + repo := ref.ref.Name() // Note that this is without a tag or digest. if path.Clean(repo) != repo { // Coverage: This should not be reachable because /./ and /../ components are not valid in docker references return nil, errors.Errorf("Unexpected path elements in Docker reference %s for signature storage", ref.ref.XString()) } diff --git a/docker/policyconfiguration/naming.go b/docker/policyconfiguration/naming.go index af2c73e7..89ed9d7b 100644 --- a/docker/policyconfiguration/naming.go +++ b/docker/policyconfiguration/naming.go @@ -12,7 +12,7 @@ import ( // as a backend for ImageReference.PolicyConfigurationIdentity. // The reference must satisfy !reference.XIsNameOnly(). func DockerReferenceIdentity(ref reference.XNamed) (string, error) { - res := ref.XFullName() + res := ref.Name() tagged, isTagged := ref.(reference.XNamedTagged) digested, isDigested := ref.(reference.XCanonical) switch { @@ -43,7 +43,7 @@ func DockerReferenceNamespaces(ref reference.XNamed) []string { // ref.FullName() == ref.Hostname() + "/" + ref.RemoteName(), so the last // iteration matches the host name (for any namespace). res := []string{} - name := ref.XFullName() + name := ref.Name() for { res = append(res, name) diff --git a/docker/reference/reference.go b/docker/reference/reference.go index 6cf31108..f6afff38 100644 --- a/docker/reference/reference.go +++ b/docker/reference/reference.go @@ -30,8 +30,6 @@ type XNamed interface { XName() string // XString returns full reference, like "ubuntu@sha256:abcdef..." XString() string - // XFullName returns full repository name with hostname, like "docker.io/library/ubuntu" - XFullName() string // XHostname returns hostname for the reference, like "docker.io" XHostname() string // XRemoteName returns the repository component of the full name, like "library/ubuntu" @@ -140,9 +138,6 @@ func (r *namedRef) XName() string { func (r *namedRef) XString() string { return distreference.FamiliarString(r) } -func (r *namedRef) XFullName() string { - return r.Name() -} func (r *namedRef) XHostname() string { return distreference.Domain(r) } diff --git a/docker/reference/reference_test.go b/docker/reference/reference_test.go index 75726600..9b5cd2e6 100644 --- a/docker/reference/reference_test.go +++ b/docker/reference/reference_test.go @@ -228,7 +228,7 @@ func TestParseRepositoryInfo(t *testing.T) { if expected, actual := tcase.NormalizedName, r.XName(); expected != actual { t.Fatalf("Invalid normalized reference for %q. Expected %q, got %q", r, expected, actual) } - if expected, actual := tcase.FullName, r.XFullName(); expected != actual { + if expected, actual := tcase.FullName, r.Name(); expected != actual { t.Fatalf("Invalid normalized reference for %q. Expected %q, got %q", r, expected, actual) } if expected, actual := tcase.Hostname, r.XHostname(); expected != actual { diff --git a/storage/storage_reference.go b/storage/storage_reference.go index 809693ec..c550f3da 100644 --- a/storage/storage_reference.go +++ b/storage/storage_reference.go @@ -87,7 +87,7 @@ func (s storageReference) PolicyConfigurationNamespaces() []string { // The reference without the ID is also a valid namespace. namespaces = append(namespaces, storeSpec+s.reference) } - components := strings.Split(s.name.XFullName(), "/") + components := strings.Split(s.name.Name(), "/") for len(components) > 0 { namespaces = append(namespaces, storeSpec+strings.Join(components, "/")) components = components[:len(components)-1] diff --git a/storage/storage_transport.go b/storage/storage_transport.go index 24ef7465..3eeb9665 100644 --- a/storage/storage_transport.go +++ b/storage/storage_transport.go @@ -282,5 +282,5 @@ func verboseName(name reference.XNamed) string { if tagged, ok := name.(reference.XNamedTagged); ok { tag = tagged.XTag() } - return name.XFullName() + ":" + tag + return name.Name() + ":" + tag }