Skip to content

Commit

Permalink
fix registry urls
Browse files Browse the repository at this point in the history
  • Loading branch information
tashima42 committed Aug 9, 2024
1 parent 7e490a1 commit 882b754
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions release/rancher/rancher.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 882b754

Please sign in to comment.