Skip to content

Commit 4b5aa34

Browse files
authored
Fix/deckhouse tag fetch another tags (#263)
Signed-off-by: Pavel Okhlopkov <pavel.okhlopkov@flant.com>
1 parent 477f271 commit 4b5aa34

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

internal/mirror/releases/versions.go

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,17 @@ func VersionsToMirror(pullParams *params.PullParams, client registry.Client, tag
4848
logger.Infof("Skipped releases lookup as tag %q is specifically requested with --deckhouse-tag", pullParams.DeckhouseTag)
4949
}
5050

51+
vers := make([]*semver.Version, 0, 1)
52+
53+
for _, tag := range tagsToMirror {
54+
v, err := semver.NewVersion(tag)
55+
if err != nil {
56+
continue
57+
}
58+
59+
vers = append(vers, v)
60+
}
61+
5162
releaseChannelsToCopy := internal.GetAllDefaultReleaseChannels()
5263
releaseChannelsToCopy = append(releaseChannelsToCopy, internal.LTSChannel)
5364

@@ -77,7 +88,6 @@ func VersionsToMirror(pullParams *params.PullParams, client registry.Client, tag
7788
}
7889
}
7990

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

112+
if len(tagsToMirror) > 0 {
113+
return deduplicateVersions(vers), channels, nil
114+
}
115+
102116
var mirrorFromVersion *semver.Version
103117
rockSolidVersion, found := releaseChannelsVersions[internal.RockSolidChannel]
104118
if found {

0 commit comments

Comments
 (0)