Skip to content

Commit

Permalink
change the source
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Leung <rleungx@gmail.com>
  • Loading branch information
rleungx committed Apr 11, 2024
1 parent aea20c0 commit 9218e5b
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 27 deletions.
3 changes: 0 additions & 3 deletions pkg/cluster/clusterutil/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,6 @@ func (r *repositoryT) VerifyComponent(comp, version, target string) error {
}

func (r *repositoryT) ComponentBinEntry(comp, version string) (string, error) {
if comp == "tso" || comp == "scheduling" {
comp = "pd"
}
versionItem, err := r.repo.ComponentVersion(comp, version, true)
if err != nil {
return "", err
Expand Down
4 changes: 2 additions & 2 deletions pkg/cluster/spec/scheduling.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,11 @@ func (c *SchedulingComponent) Role() string {

// Source implements Component interface.
func (c *SchedulingComponent) Source() string {
source := c.Topology.ComponentSources.Scheduling
source := c.Topology.ComponentSources.PD
if source != "" {
return source
}
return ComponentScheduling
return ComponentPD
}

// CalculateVersion implements the Component interface
Expand Down
20 changes: 9 additions & 11 deletions pkg/cluster/spec/spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,17 +159,15 @@ type (

// ComponentSources represents the source of components
ComponentSources struct {
TiDB string `yaml:"tidb,omitempty" validate:"tidb:editable"`
TiKV string `yaml:"tikv,omitempty" validate:"tikv:editable"`
TiFlash string `yaml:"tiflash,omitempty" validate:"tiflash:editable"`
PD string `yaml:"pd,omitempty" validate:"pd:editable"`
TSO string `yaml:"tso,omitempty" validate:"tso:editable"`
Scheduling string `yaml:"scheduling,omitempty" validate:"schedulng:editable"`
Dashboard string `yaml:"tidb_dashboard,omitempty" validate:"tidb_dashboard:editable"`
Pump string `yaml:"pump,omitempty" validate:"pump:editable"`
Drainer string `yaml:"drainer,omitempty" validate:"drainer:editable"`
CDC string `yaml:"cdc,omitempty" validate:"cdc:editable"`
TiKVCDC string `yaml:"kvcdc,omitempty" validate:"kvcdc:editable"`
TiDB string `yaml:"tidb,omitempty" validate:"tidb:editable"`
TiKV string `yaml:"tikv,omitempty" validate:"tikv:editable"`
TiFlash string `yaml:"tiflash,omitempty" validate:"tiflash:editable"`
PD string `yaml:"pd,omitempty" validate:"pd:editable"`
Dashboard string `yaml:"tidb_dashboard,omitempty" validate:"tidb_dashboard:editable"`
Pump string `yaml:"pump,omitempty" validate:"pump:editable"`
Drainer string `yaml:"drainer,omitempty" validate:"drainer:editable"`
CDC string `yaml:"cdc,omitempty" validate:"cdc:editable"`
TiKVCDC string `yaml:"kvcdc,omitempty" validate:"kvcdc:editable"`
}

// Specification represents the specification of topology.yaml
Expand Down
4 changes: 2 additions & 2 deletions pkg/cluster/spec/tso.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,11 @@ func (c *TSOComponent) Role() string {

// Source implements Component interface.
func (c *TSOComponent) Source() string {
source := c.Topology.ComponentSources.TSO
source := c.Topology.ComponentSources.PD
if source != "" {
return source
}
return ComponentTSO
return ComponentPD
}

// CalculateVersion implements the Component interface
Expand Down
9 changes: 0 additions & 9 deletions pkg/cluster/task/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,6 @@ func (b *Builder) CopyFile(src, dst, server string, download bool, limit int, co

// Download appends a Downloader task to the current task collection
func (b *Builder) Download(component, os, arch string, version string) *Builder {
if component == "tso" || component == "scheduling" {
component = "pd"
}
b.tasks = append(b.tasks, NewDownloader(component, os, arch, version))
return b
}
Expand All @@ -213,9 +210,6 @@ func (b *Builder) CopyComponent(component, os, arch string,
version string,
srcPath, dstHost, dstDir string,
) *Builder {
if component == "tso" || component == "scheduling" {
component = "pd"
}
b.tasks = append(b.tasks, &CopyComponent{
component: component,
os: os,
Expand All @@ -240,9 +234,6 @@ func (b *Builder) InstallPackage(srcPath, dstHost, dstDir string) *Builder {

// BackupComponent appends a BackupComponent task to the current task collection
func (b *Builder) BackupComponent(component, fromVer string, host, deployDir string) *Builder {
if component == "tso" || component == "scheduling" {
component = "pd"
}
b.tasks = append(b.tasks, &BackupComponent{
component: component,
fromVer: fromVer,
Expand Down

0 comments on commit 9218e5b

Please sign in to comment.