Skip to content

Commit

Permalink
fix dm error
Browse files Browse the repository at this point in the history
  • Loading branch information
nexustar committed Oct 25, 2021
1 parent 6d078e9 commit 53444cc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 5 additions & 3 deletions pkg/cluster/manager/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,11 @@ func (m *Manager) Deploy(
if err := spec.ParseTopologyYaml(topoFile, topo); err != nil {
return err
}
if semver.Compare(clusterVersion, "v4.0.5") < 0 &&
len(topo.(*spec.Specification).TiFlashServers) > 0 {
return fmt.Errorf("TiFlash %s is not supported in TLS enabled cluster", clusterVersion)
if clusterSpec, ok := topo.(*spec.Specification); ok {
if semver.Compare(clusterVersion, "v4.0.5") < 0 &&
len(clusterSpec.TiFlashServers) > 0 {
return fmt.Errorf("TiFlash %s is not supported in TLS enabled cluster", clusterVersion)
}
}

instCnt := 0
Expand Down
8 changes: 5 additions & 3 deletions pkg/cluster/manager/scale_out.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,11 @@ func (m *Manager) ScaleOut(
return err
}

if semver.Compare(base.Version, "v4.0.5") < 0 &&
len(topo.(*spec.Specification).TiFlashServers) > 0 {
return fmt.Errorf("TiFlash %s is not supported in TLS enabled cluster", base.Version)
if clusterSpec, ok := topo.(*spec.Specification); ok {
if semver.Compare(base.Version, "v4.0.5") < 0 &&
len(clusterSpec.TiFlashServers) > 0 {
return fmt.Errorf("TiFlash %s is not supported in TLS enabled cluster", base.Version)
}
}

if newPartTopo, ok := newPart.(*spec.Specification); ok {
Expand Down

0 comments on commit 53444cc

Please sign in to comment.