Skip to content

Commit

Permalink
mirror: fix user may clone wrong component version
Browse files Browse the repository at this point in the history
  • Loading branch information
nexustar committed Nov 9, 2023
1 parent 702c95c commit 2fdc71d
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions pkg/repository/clone_mirror.go
Original file line number Diff line number Diff line change
Expand Up @@ -419,19 +419,20 @@ func checkVersion(options CloneOptions, versions set.StringSet, version string)

func combineVersions(versions *[]string,
manifest *v1manifest.Component, oss, archs,
selectedVersions []string) set.StringSet {
if (versions == nil || len(*versions) < 1) && len(selectedVersions) < 1 {
globalVersions []string) set.StringSet {
if (versions == nil || len(*versions) < 1) && len(globalVersions) < 1 {
return nil
}

result := set.NewStringSet()
if versions != nil && len(*versions) > 0 {
result = set.NewStringSet(*versions...)
// The version specified by the user has the highest priority
return set.NewStringSet(*versions...)
}

// Some components version binding to TiDB
// Users should specify the specific component version. "coreSuits" just remain for compatibility
coreSuites := set.NewStringSet("tidb", "tikv", "pd", "tiflash", "prometheus", "grafana", "ctl", "cdc")

result := set.NewStringSet()
for _, os := range oss {
for _, arch := range archs {
platform := PlatformString(os, arch)
Expand All @@ -448,7 +449,7 @@ func combineVersions(versions *[]string,
}
}

for _, selectedVersion := range selectedVersions {
for _, selectedVersion := range globalVersions {
if selectedVersion == utils.NightlyVersionAlias {
selectedVersion = manifest.Nightly
}
Expand Down

0 comments on commit 2fdc71d

Please sign in to comment.