Skip to content

Commit

Permalink
Fix ti-spark scale-out (#901)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucklove committed Nov 19, 2020
1 parent 05d0d05 commit 3537ffe
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
4 changes: 2 additions & 2 deletions cmd/mirror.go
Original file line number Diff line number Diff line change
Expand Up @@ -670,8 +670,8 @@ func newMirrorCloneCmd() *cobra.Command {
}
defer repo.Mirror().Close()

var versionMapper = func(ver string) string {
return spec.TiDBComponentVersion(ver, "")
var versionMapper = func(comp string) string {
return spec.TiDBComponentVersion(comp, "")
}

return repository.CloneMirror(repo, components, versionMapper, args[0], args[1:], options)
Expand Down
3 changes: 0 additions & 3 deletions pkg/cluster/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -817,9 +817,6 @@ func (m *Manager) Upgrade(clusterName string, clusterVersion string, opt operato
for _, comp := range topo.ComponentsByUpdateOrder() {
for _, inst := range comp.Instances() {
version := m.bindVersion(inst.ComponentName(), clusterVersion)
if version == "" {
return perrs.Errorf("unsupported component: %v", inst.ComponentName())
}
compInfo := componentInfo{
component: inst.ComponentName(),
version: version,
Expand Down
2 changes: 2 additions & 0 deletions pkg/cluster/spec/bindversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ func TiDBComponentVersion(comp, version string) string {
return "v0.7.0"
case ComponentCheckCollector:
return "v0.3.1"
case ComponentSpark, ComponentTiSpark:
return "" // empty version should be treate as the the last stable one
default:
return version
}
Expand Down
7 changes: 7 additions & 0 deletions pkg/repository/v1_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -731,6 +731,13 @@ func (r *V1Repository) ComponentVersion(id, version string, includeYanked bool)
if v0manifest.Version(version).IsNightly() && manifest.Nightly != "" {
version = manifest.Nightly
}
if version == "" {
v, _, err := r.LatestStableVersion(id, includeYanked)
if err != nil {
return nil, err
}
version = v.String()
}
vi := manifest.VersionItem(r.PlatformString(), version, includeYanked)
if vi == nil {
return nil, fmt.Errorf("version %s on %s for component %s not found", version, r.PlatformString(), id)
Expand Down

0 comments on commit 3537ffe

Please sign in to comment.