Skip to content

Commit afab765

Browse files
committed
registry/client: remove uses of APIEndpoint.TrimHostName
This field was added in moby/moby@19515a7, 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 <github@gone.nl>
1 parent e554bfe commit afab765

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

cli/registry/client/endpoint.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,7 @@ type repositoryEndpoint struct {
2222

2323
// Name returns the repository name
2424
func (r repositoryEndpoint) Name() string {
25-
repoName := r.info.Name.Name()
26-
// If endpoint does not support CanonicalName, use the RemoteName instead
27-
if r.endpoint.TrimHostname {
28-
repoName = reference.Path(r.info.Name)
29-
}
30-
return repoName
25+
return reference.Path(r.info.Name)
3126
}
3227

3328
// BaseURL returns the endpoint url

0 commit comments

Comments
 (0)