(imageName string)
| 409 | } |
| 410 | |
| 411 | func 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 | |
| 423 | func normalizeRegistryHost(registryKey string) string { |
| 424 | key := strings.TrimSpace(registryKey) |
no test coverage detected