splitReposSearchTerm breaks a search term into an index name and remote name
(reposName string)
| 117 | |
| 118 | // splitReposSearchTerm breaks a search term into an index name and remote name |
| 119 | func splitReposSearchTerm(reposName string) string { |
| 120 | nameParts := strings.SplitN(reposName, "/", 2) |
| 121 | if len(nameParts) == 1 || (!strings.Contains(nameParts[0], ".") && !strings.Contains(nameParts[0], ":") && nameParts[0] != "localhost") { |
| 122 | // This is a Docker Hub repository (ex: samalba/hipache or ubuntu), |
| 123 | // use the default Docker Hub registry (docker.io) |
| 124 | return "docker.io" |
| 125 | } |
| 126 | return nameParts[0] |
| 127 | } |