unite trust.ParseServerAddress & helpers.NormalizeRegistry

This commit is contained in:
Reinier van der Leer 2023-01-22 16:56:44 +01:00
parent f0e075c390
commit 85f5c1fdb1
No known key found for this signature in database
GPG key ID: DBC4942A5C29D7FA
8 changed files with 46 additions and 95 deletions

View file

@ -177,9 +177,7 @@ func GetScopeFromImageName(img, svc string) string {
// GetChallengeURL creates a URL object based on the image info
func GetChallengeURL(img string) (url.URL, error) {
normalizedNamed, _ := reference.ParseNormalizedNamed(img)
host, err := helpers.NormalizeRegistry(normalizedNamed.String())
host, err := helpers.GetRegistryAddress(img)
if err != nil {
return url.URL{}, err
}