Skip to content

Commit

Permalink
mirror: return err if specified latest not found when clone mirror (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
nexustar authored Nov 13, 2023
1 parent 3199925 commit 2b79923
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions pkg/repository/clone_mirror.go
Original file line number Diff line number Diff line change
Expand Up @@ -432,9 +432,6 @@ func combineVersions(componentVersions *[]string,
for _, arch := range archs {
platform := PlatformString(os, arch)
versionList := manifest.VersionList(platform)
if versionList == nil {
continue
}

// set specified version with latest tag
if result.Exist(utils.LatestVersionAlias) {
Expand All @@ -453,17 +450,14 @@ func combineVersions(componentVersions *[]string,

if selectedVersion == utils.LatestVersionAlias {
latest := manifest.LatestVersion(platform)
if latest == "" {
continue
if latest != "" {
fmt.Printf("%s %s/%s found the lastest version %s\n", manifest.ID, os, arch, latest)
// set latest version
selectedVersion = latest
}

fmt.Printf("%s %s/%s found the lastest version %s\n", manifest.ID, os, arch, latest)
// set latest version
selectedVersion = latest
}

_, found := versionList[selectedVersion]
fmt.Println(found)
if !found {
return nil, errors.Errorf("version %s not found in %s %s/%s", selectedVersion, manifest.ID, os, arch)
}
Expand Down

0 comments on commit 2b79923

Please sign in to comment.