Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nexustar committed Aug 9, 2023
1 parent b0bb466 commit cbda852
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 37 deletions.
10 changes: 4 additions & 6 deletions components/dm/spec/topology_dm.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,10 @@ func (s *MasterSpec) GetAdvertisePeerURL(enableTLS bool) string {

// GetSource returns source to download the component
func (s *MasterSpec) GetSource() string {
if s.Source != "" {
return s.Source
} else {
if s.Source == "" {
return ComponentDMMaster
}
return s.Source
}

// WorkerSpec represents the Master topology specification in topology.yaml
Expand Down Expand Up @@ -285,11 +284,10 @@ func (s *WorkerSpec) IgnoreMonitorAgent() bool {

// GetSource returns source to download the component
func (s *WorkerSpec) GetSource() string {
if s.Source != "" {
return s.Source
} else {
if s.Source == "" {
return ComponentDMWorker
}
return s.Source
}

// UnmarshalYAML sets default values when unmarshaling the topology file
Expand Down
5 changes: 2 additions & 3 deletions pkg/cluster/spec/cdc.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,10 @@ func (s *CDCSpec) IgnoreMonitorAgent() bool {

// GetSource returns source to download the component
func (s *CDCSpec) GetSource() string {
if s.Source != "" {
return s.Source
} else {
if s.Source == "" {
return ComponentCDC
}
return s.Source
}

// CDCComponent represents CDC component.
Expand Down
5 changes: 2 additions & 3 deletions pkg/cluster/spec/dashboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,10 @@ func (s *DashboardSpec) IgnoreMonitorAgent() bool {

// GetSource returns source to download the component
func (s *DashboardSpec) GetSource() string {
if s.Source != "" {
return s.Source
} else {
if s.Source == "" {
return ComponentDashboard
}
return s.Source
}

// DashboardComponent represents Drainer component.
Expand Down
5 changes: 2 additions & 3 deletions pkg/cluster/spec/drainer.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,10 @@ func (s *DrainerSpec) IgnoreMonitorAgent() bool {

// GetSource returns source to download the component
func (s *DrainerSpec) GetSource() string {
if s.Source != "" {
return s.Source
} else {
if s.Source == "" {
return ComponentDrainer
}
return s.Source
}

// DrainerComponent represents Drainer component.
Expand Down
5 changes: 2 additions & 3 deletions pkg/cluster/spec/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,11 +306,10 @@ func (i *BaseInstance) ComponentName() string {

// ComponentSource implements Instance interface
func (i *BaseInstance) ComponentSource() string {
if i.Source != "" {
return i.Source
} else {
if i.Source == "" {
return i.Name
}
return i.Source
}

// InstanceName implements Instance interface
Expand Down
5 changes: 2 additions & 3 deletions pkg/cluster/spec/pd.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,10 @@ func (s *PDSpec) GetAdvertisePeerURL(enableTLS bool) string {

// GetSource returns source to download the component
func (s *PDSpec) GetSource() string {
if s.Source != "" {
return s.Source
} else {
if s.Source == "" {
return ComponentPD
}
return s.Source
}

// PDComponent represents PD component.
Expand Down
7 changes: 3 additions & 4 deletions pkg/cluster/spec/pump.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,10 @@ func (s *PumpSpec) IgnoreMonitorAgent() bool {

// GetSource returns source to download the component
func (s *PumpSpec) GetSource() string {
if s.Source != "" {
return s.Source
} else {
return ComponentCDC
if s.Source == "" {
return ComponentPump
}
return s.Source
}

// PumpComponent represents Pump component.
Expand Down
5 changes: 2 additions & 3 deletions pkg/cluster/spec/tidb.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,10 @@ func (s *TiDBSpec) IgnoreMonitorAgent() bool {

// GetSource returns source to download the component
func (s *TiDBSpec) GetSource() string {
if s.Source != "" {
return s.Source
} else {
if s.Source == "" {
return ComponentTiDB
}
return s.Source
}

// TiDBComponent represents TiDB component.
Expand Down
5 changes: 2 additions & 3 deletions pkg/cluster/spec/tiflash.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,10 @@ func (s *TiFlashSpec) IgnoreMonitorAgent() bool {

// GetSource returns source to download the component
func (s *TiFlashSpec) GetSource() string {
if s.Source != "" {
return s.Source
} else {
if s.Source == "" {
return ComponentTiFlash
}
return s.Source
}

// key names for storage config
Expand Down
5 changes: 2 additions & 3 deletions pkg/cluster/spec/tikv.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,10 @@ func (s *TiKVSpec) Labels() (map[string]string, error) {

// GetSource returns source to download the component
func (s *TiKVSpec) GetSource() string {
if s.Source != "" {
return s.Source
} else {
if s.Source == "" {
return ComponentTiKV
}
return s.Source
}

// TiKVComponent represents TiKV component.
Expand Down
5 changes: 2 additions & 3 deletions pkg/cluster/spec/tikv_cdc.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,10 @@ func (c *TiKVCDCComponent) Role() string {

// GetSource returns source to download the component
func (s *TiKVCDCSpec) GetSource() string {
if s.Source != "" {
return s.Source
} else {
if s.Source == "" {
return ComponentTiKVCDC
}
return s.Source
}

// Instances implements Component interface.
Expand Down

0 comments on commit cbda852

Please sign in to comment.