// Get a repos name and returns the right reposName + tag|digest
// The tag can be confusing because of a port in a repository name.
//     Ex: localhost.localdomain:5000/samalba/hipache:latest
//     Digest ex: localhost:5000/foo/bar@sha256:bc8813ea7b3603864987522f02a76101c17ad122e1c46d790efc0fca78ca7bfb
Get a repos name and returns the right reposName + tag|digest
The tag can be confusing because of a port in a repository name.
// Get a repos name and returns the right reposName + tag|digest // The tag can be confusing because of a port in a repository name . // Ex : localhost . localdomain : 5000 / samalba / hipache : latest // Digest ex : localhost : 5000 / foo / bar@sha256 : bc8813ea7b3603864987522f02a76101c17ad122e1c46d790efc0fca78ca7bfb
func parseRepositoryTag(repos string) (string, string) {
	n := strings.Index(repos, "@")
	if n >= 0 {
		parts := strings.Split(repos, "@")
		return parts[0], parts[1]
	}
	n = strings.LastIndex(repos, ":")
	if n < 0 {
		return repos, "latest"
	}
	if tag := repos[n+1:]; !strings.Contains(tag, "/") {
		return repos[:n], tag
	}
	return repos, "latest"
}
func parseRepositoryTag ( repos string ) ( string , string ) { n := strings . Index ( repos , " " ) if n >= 0 { parts := strings . Split ( repos , " " ) return parts [ 0 ] , parts [ 1 ] } n = strings . LastIndex ( repos , " " ) if n < 0 { return repos , " " } if tag := repos [ n + 1 : ] ; ! strings . Contains ( tag , " " ) { return repos [ : n ] , tag } return repos , " " }
Get a repos name and returns the right reposName + tag|digest
The tag can be confusing because of a port in a repository name.
Get a repos name and returns the right reposName + tag|digest The tag can be confusing because of a port in a repository name .