Merge pull request #2053 from dmcgowan/add-trim-name

Add trim name method helper to create name only references
This commit is contained in:
Derek McGowan 2016-11-10 15:03:34 -08:00 committed by GitHub
commit 8016d2d890

View file

@ -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