replace deprecated function
Signed-off-by: Zou Nengren <zouyee1989@gmail.com>
This commit is contained in:
parent
f40df655cd
commit
694a007543
@ -338,11 +338,13 @@ func WithDigest(name Named, digest digest.Digest) (Canonical, error) {
|
|||||||
|
|
||||||
// TrimNamed removes any tag or digest from the named reference.
|
// TrimNamed removes any tag or digest from the named reference.
|
||||||
func TrimNamed(ref Named) Named {
|
func TrimNamed(ref Named) Named {
|
||||||
domain, path := SplitHostname(ref)
|
repo := repository{}
|
||||||
return repository{
|
if r, ok := ref.(namedRepository); ok {
|
||||||
domain: domain,
|
repo.domain, repo.path = r.Domain(), r.Path()
|
||||||
path: path,
|
} else {
|
||||||
|
repo.domain, repo.path = splitDomain(ref.Name())
|
||||||
}
|
}
|
||||||
|
return repo
|
||||||
}
|
}
|
||||||
|
|
||||||
func getBestReferenceType(ref reference) Reference {
|
func getBestReferenceType(ref reference) Reference {
|
||||||
|
Loading…
Reference in New Issue
Block a user