Skip to content

Commit

Permalink
remove bindVersion
Browse files Browse the repository at this point in the history
  • Loading branch information
nexustar committed Sep 11, 2023
1 parent 67258a2 commit e899ab5
Show file tree
Hide file tree
Showing 8 changed files with 5 additions and 31 deletions.
2 changes: 1 addition & 1 deletion components/cluster/command/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func init() {
}

tidbSpec = spec.GetSpecManager()
cm = manager.NewManager("tidb", tidbSpec, spec.TiDBComponentVersion, log)
cm = manager.NewManager("tidb", tidbSpec, log)
if cmd.Name() != "__complete" {
logger.EnableAuditLog(spec.AuditDir())
}
Expand Down
2 changes: 1 addition & 1 deletion components/dm/command/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ please backup your data before process.`,

dmspec = spec.GetSpecManager()
logger.EnableAuditLog(cspec.AuditDir())
cm = manager.NewManager("dm", dmspec, spec.DMComponentVersion, log)
cm = manager.NewManager("dm", dmspec, log)

// Running in other OS/ARCH Should be fine we only download manifest file.
env, err = tiupmeta.InitEnv(repository.Options{
Expand Down
18 changes: 0 additions & 18 deletions components/dm/spec/bindversion.go

This file was deleted.

2 changes: 0 additions & 2 deletions pkg/cluster/manager/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ func buildScaleOutTask(
newPart,
m.logger,
gOpt,
m.bindVersion,
)

sshType := topo.BaseTopo().GlobalOptions.SSHType
Expand Down Expand Up @@ -684,7 +683,6 @@ func buildDownloadCompTasks(
topo spec.Topology,
logger *logprinter.Logger,
gOpt operator.Options,
bindVersion spec.BindVersion,
) []*task.StepDisplay {
var tasks []*task.StepDisplay
uniqueTaskList := set.NewStringSet()
Expand Down
2 changes: 1 addition & 1 deletion pkg/cluster/manager/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ func (m *Manager) Deploy(
}

// Download missing component
downloadCompTasks = buildDownloadCompTasks(clusterVersion, topo, m.logger, gOpt, m.bindVersion)
downloadCompTasks = buildDownloadCompTasks(clusterVersion, topo, m.logger, gOpt)

// Deploy components to remote
topo.IterInstance(func(inst spec.Instance) {
Expand Down
3 changes: 0 additions & 3 deletions pkg/cluster/manager/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,21 +45,18 @@ var (
type Manager struct {
sysName string
specManager *spec.SpecManager
bindVersion spec.BindVersion
logger *logprinter.Logger
}

// NewManager create a Manager.
func NewManager(
sysName string,
specManager *spec.SpecManager,
bindVersion spec.BindVersion,
logger *logprinter.Logger,
) *Manager {
return &Manager{
sysName: sysName,
specManager: specManager,
bindVersion: bindVersion,
logger: logger,
}
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/cluster/manager/patch.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func (m *Manager) Patch(name string, packagePath string, opt operator.Options, o
if err != nil {
return err
}
if err := checkPackage(m.bindVersion, m.specManager, name, insts[0], insts[0].OS(), insts[0].Arch(), packagePath); err != nil {
if err := checkPackage(m.specManager, name, insts[0], insts[0].OS(), insts[0].Arch(), packagePath); err != nil {
return err
}

Expand Down Expand Up @@ -139,7 +139,7 @@ func (m *Manager) Patch(name string, packagePath string, opt operator.Options, o
return m.specManager.SaveMeta(name, metadata)
}

func checkPackage(bindVersion spec.BindVersion, specManager *spec.SpecManager, name string, inst spec.Instance, nodeOS, arch, packagePath string) error {
func checkPackage(specManager *spec.SpecManager, name string, inst spec.Instance, nodeOS, arch, packagePath string) error {
metadata := specManager.NewMetadata()
if err := specManager.Metadata(name, metadata); err != nil {
return err
Expand Down
3 changes: 0 additions & 3 deletions pkg/cluster/spec/server_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,9 +260,6 @@ func mergeImported(importConfig []byte, specConfigs ...map[string]any) (map[stri
return lhs, nil
}

// BindVersion map the cluster version to the third components binding version.
type BindVersion func(comp string, version string) (bindVersion string)

func checkConfig(ctx context.Context, e ctxt.Executor, componentName, componentSource, version, nodeOS, arch, config string, paths meta.DirPaths) error {
var cmd string
configPath := path.Join(paths.Deploy, "conf", config)
Expand Down

0 comments on commit e899ab5

Please sign in to comment.