Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ti-spark scale-out #901

Merged
merged 1 commit into from
Nov 11, 2020
Merged
Show file tree
Hide file tree
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
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