From 882b754c6c4f3857767bcbe425616f83f80d9123 Mon Sep 17 00:00:00 2001 From: Pedro Tashima <23709916+tashima42@users.noreply.github.com> Date: Fri, 9 Aug 2024 12:13:31 -0300 Subject: [PATCH] fix registry urls --- release/rancher/rancher.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/release/rancher/rancher.go b/release/rancher/rancher.go index e89b40fb..3f04350b 100644 --- a/release/rancher/rancher.go +++ b/release/rancher/rancher.go @@ -413,6 +413,11 @@ func GenerateMissingImagesList(imagesListURL, registry string, concurrencyLimit repositoryAuths := make(map[string]string) mu := sync.RWMutex{} + rgInfo, ok := registriesInfo[registry] + if !ok { + return nil, errors.New("registry must be one of the following: 'docker.io', 'registry.rancher.com' or 'stgregistry.suse.com'") + } + for _, imageAndVersion := range checkImages { image, imageVersion, err := splitImageAndVersion(imageAndVersion) if err != nil { @@ -441,7 +446,7 @@ func GenerateMissingImagesList(imagesListURL, registry string, concurrencyLimit auth, ok = repositoryAuths[image] if !ok { - auth, err = registryAuth(sccSUSEURL, sccSUSEService, image) + auth, err = registryAuth(rgInfo.AuthURL, rgInfo.Service, image) if err != nil { cancel() return err @@ -450,7 +455,7 @@ func GenerateMissingImagesList(imagesListURL, registry string, concurrencyLimit } mu.Unlock() - exists, err := checkIfImageExists(rancherRegistryBaseURL, image, imageVersion, auth) + exists, err := checkIfImageExists(rgInfo.BaseURL, image, imageVersion, auth) if err != nil { cancel() return err