From afab765014c37f9af1de47ea4b8faf4ebba8186a Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Fri, 6 Dec 2024 23:06:01 +0100 Subject: [PATCH] registry/client: remove uses of APIEndpoint.TrimHostName This field was added in https://github.com/moby/moby/commit/19515a7ad859b28c474d81e756ac245afcd968e3, but looks to be always set for endpoints used, so we can trim remote names unconditionally. This option was added for possible future expansion, allowing registry- mirrors to get the full reference of the image (including domain-name), for them to host a mirror for multiple upstreams on the same registry. That approach will unlikely be implemented, and containerd has a different approach for this, where the reference to the original registry is passed through a query parameter instead. Signed-off-by: Sebastiaan van Stijn --- cli/registry/client/endpoint.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/cli/registry/client/endpoint.go b/cli/registry/client/endpoint.go index e06bfea50bc5..2446da85a044 100644 --- a/cli/registry/client/endpoint.go +++ b/cli/registry/client/endpoint.go @@ -22,12 +22,7 @@ type repositoryEndpoint struct { // Name returns the repository name func (r repositoryEndpoint) Name() string { - repoName := r.info.Name.Name() - // If endpoint does not support CanonicalName, use the RemoteName instead - if r.endpoint.TrimHostname { - repoName = reference.Path(r.info.Name) - } - return repoName + return reference.Path(r.info.Name) } // BaseURL returns the endpoint url