MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / extractRegistryHost

Function extractRegistryHost

agent/utils/docker/docker.go:411–421  ·  view source on GitHub ↗
(imageName string)

Source from the content-addressed store, hash-verified

409}
410
411func extractRegistryHost(imageName string) (string, bool) {
412 parts := strings.Split(imageName, "/")
413 if len(parts) < 2 {
414 return "", false
415 }
416 first := parts[0]
417 if strings.Contains(first, ".") || strings.Contains(first, ":") || first == "localhost" {
418 return normalizeRegistryHost(first), true
419 }
420 return "", false
421}
422
423func normalizeRegistryHost(registryKey string) string {
424 key := strings.TrimSpace(registryKey)

Callers 1

Calls 1

normalizeRegistryHostFunction · 0.85

Tested by

no test coverage detected