replace deprecated function

Signed-off-by: Zou Nengren <zouyee1989@gmail.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 79d1901549)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
zounengren 2021-09-27 04:29:46 +08:00 committed by Sebastiaan van Stijn
parent 27206bcd3b
commit 2c4bf1a664
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C

View file

@ -320,11 +320,13 @@ func WithDigest(name Named, digest digest.Digest) (Canonical, error) {
// TrimNamed removes any tag or digest from the named reference.
func TrimNamed(ref Named) Named {
domain, path := SplitHostname(ref)
return repository{
domain: domain,
path: path,
repo := repository{}
if r, ok := ref.(namedRepository); ok {
repo.domain, repo.path = r.Domain(), r.Path()
} else {
repo.domain, repo.path = splitDomain(ref.Name())
}
return repo
}
func getBestReferenceType(ref reference) Reference {