Skip to content

Commit

Permalink
replace deprecated function
Browse files Browse the repository at this point in the history
Signed-off-by: Zou Nengren <zouyee1989@gmail.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 79d1901)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
  • Loading branch information
zounengren authored and thaJeztah committed Aug 31, 2023
1 parent 27206bc commit 2c4bf1a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions reference/reference.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 2c4bf1a

Please sign in to comment.