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

Function normalizeRegistryHost

agent/utils/docker/docker.go:423–435  ·  view source on GitHub ↗
(registryKey string)

Source from the content-addressed store, hash-verified

421}
422
423func normalizeRegistryHost(registryKey string) string {
424 key := strings.TrimSpace(registryKey)
425 if key == "" {
426 return ""
427 }
428 key = strings.TrimPrefix(key, "http://")
429 key = strings.TrimPrefix(key, "https://")
430 key = strings.Trim(key, "/")
431 if strings.Contains(key, "/") {
432 key = strings.SplitN(key, "/", 2)[0]
433 }
434 return strings.ToLower(key)
435}

Callers 2

isDockerHubRegistryFunction · 0.85
extractRegistryHostFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected