Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion internal/mirror/releases/versions.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,17 @@ func VersionsToMirror(pullParams *params.PullParams, client registry.Client, tag
logger.Infof("Skipped releases lookup as tag %q is specifically requested with --deckhouse-tag", pullParams.DeckhouseTag)
}

vers := make([]*semver.Version, 0, 1)

for _, tag := range tagsToMirror {
v, err := semver.NewVersion(tag)
if err != nil {
continue
}

vers = append(vers, v)
}

releaseChannelsToCopy := internal.GetAllDefaultReleaseChannels()
releaseChannelsToCopy = append(releaseChannelsToCopy, internal.LTSChannel)

Expand Down Expand Up @@ -77,7 +88,6 @@ func VersionsToMirror(pullParams *params.PullParams, client registry.Client, tag
}
}

vers := make([]*semver.Version, 0, len(releaseChannelsVersions))
mappedChannels := make(map[string]struct{}, len(releaseChannelsVersions))
for channel, v := range releaseChannelsVersions {
if len(tagsToMirror) == 0 {
Expand All @@ -99,6 +109,10 @@ func VersionsToMirror(pullParams *params.PullParams, client registry.Client, tag
channels = append(channels, channel)
}

if len(tagsToMirror) > 0 {
return deduplicateVersions(vers), channels, nil
}

var mirrorFromVersion *semver.Version
rockSolidVersion, found := releaseChannelsVersions[internal.RockSolidChannel]
if found {
Expand Down