Merge pull request #2053 from dmcgowan/add-trim-name
Add trim name method helper to create name only references
This commit is contained in:
commit
8016d2d890
1 changed files with 5 additions and 0 deletions
|
@ -261,6 +261,11 @@ func Match(pattern string, ref Reference) (bool, error) {
|
||||||
return matched, err
|
return matched, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TrimNamed removes any tag or digest from the named reference.
|
||||||
|
func TrimNamed(ref Named) Named {
|
||||||
|
return repository(ref.Name())
|
||||||
|
}
|
||||||
|
|
||||||
func getBestReferenceType(ref reference) Reference {
|
func getBestReferenceType(ref reference) Reference {
|
||||||
if ref.name == "" {
|
if ref.name == "" {
|
||||||
// Allow digest only references
|
// Allow digest only references
|
||||||
|
|
Loading…
Reference in a new issue