MCPcopy Create free account
hub / github.com/docker/cli / splitReposSearchTerm

Function splitReposSearchTerm

cli/command/registry/search.go:119–127  ·  view source on GitHub ↗

splitReposSearchTerm breaks a search term into an index name and remote name

(reposName string)

Source from the content-addressed store, hash-verified

117
118// splitReposSearchTerm breaks a search term into an index name and remote name
119func 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}

Callers 1

getAuthFunction · 0.85

Calls 1

ContainsMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…