Skip to content

Commit

Permalink
*: fix typo (#2487)
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Leung <[email protected]>
  • Loading branch information
rleungx authored Jan 8, 2025
1 parent abc1b45 commit f57aa1d
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions components/playground/instance/pd.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ func (inst *PDInstance) Start(ctx context.Context) error {
fmt.Sprintf("--log-file=%s", inst.LogFile()),
fmt.Sprintf("--config=%s", configPath),
}
if tidbver.PDSupportMicroServicesWithName(inst.Version.String()) {
if tidbver.PDSupportMicroservicesWithName(inst.Version.String()) {
args = append(args, fmt.Sprintf("--name=%s", uid))
}
case PDRoleScheduling:
Expand All @@ -164,7 +164,7 @@ func (inst *PDInstance) Start(ctx context.Context) error {
fmt.Sprintf("--log-file=%s", inst.LogFile()),
fmt.Sprintf("--config=%s", configPath),
}
if tidbver.PDSupportMicroServicesWithName(inst.Version.String()) {
if tidbver.PDSupportMicroservicesWithName(inst.Version.String()) {
args = append(args, fmt.Sprintf("--name=%s", uid))
}
}
Expand Down
2 changes: 1 addition & 1 deletion components/playground/playground.go
Original file line number Diff line number Diff line change
Expand Up @@ -1157,7 +1157,7 @@ func (p *Playground) bootCluster(ctx context.Context, env *environment.Environme
instances...,
)
} else if options.PDMode == "ms" {
if !tidbver.PDSupportMicroServices(options.Version) {
if !tidbver.PDSupportMicroservices(options.Version) {
return fmt.Errorf("PD cluster doesn't support microservices mode in version %s", options.Version)
}
instances = append([]InstancePair{
Expand Down
8 changes: 4 additions & 4 deletions pkg/cluster/api/pdapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ func (pc *PDClient) CheckHealth() error {
return nil
}

// CheckTSOHealth checks the health of TSO service(which is a Micro Service component of PD)
// CheckTSOHealth checks the health of TSO service(which is a microservice component of PD)
func (pc *PDClient) CheckTSOHealth(retryOpt *utils.RetryOption) error {
endpoints := pc.getEndpoints(tsoHealthPrefix)

Expand All @@ -218,10 +218,10 @@ func (pc *PDClient) CheckTSOHealth(retryOpt *utils.RetryOption) error {
}

// return error by default, to make the retry work
pc.l().Debugf("Still waiting for the PD Micro Service's TSO health")
return perrs.New("Still waiting for the PD Micro Service's TSO health")
pc.l().Debugf("Still waiting for the PD microservice's TSO health")
return perrs.New("Still waiting for the PD microservice's TSO health")
}, *retryOpt); err != nil {
return fmt.Errorf("error check PD Micro Service's TSO health, %v", err)
return fmt.Errorf("error check PD microservice's TSO health, %v", err)
}

return nil
Expand Down
2 changes: 1 addition & 1 deletion pkg/cluster/spec/scheduling.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ func (i *SchedulingInstance) InitConfig(
LogDir: paths.Log,
NumaNode: spec.NumaNode,
}
if !tidbver.PDSupportMicroServicesWithName(version) {
if !tidbver.PDSupportMicroservicesWithName(version) {
cfg.Name = ""
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/cluster/spec/tso.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ func (i *TSOInstance) InitConfig(
LogDir: paths.Log,
NumaNode: spec.NumaNode,
}
if !tidbver.PDSupportMicroServicesWithName(version) {
if !tidbver.PDSupportMicroservicesWithName(version) {
cfg.Name = ""
}

Expand Down
8 changes: 4 additions & 4 deletions pkg/tidbver/tidbver.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,13 @@ func TiFlashPlaygroundNewStartMode(version string) bool {
return semver.Compare(version, "v7.1.0") >= 0 || strings.Contains(version, "nightly")
}

// PDSupportMicroServices returns true if the given version of PD supports micro services.
func PDSupportMicroServices(version string) bool {
// PDSupportMicroservices returns true if the given version of PD supports microservices.
func PDSupportMicroservices(version string) bool {
return semver.Compare(version, "v7.3.0") >= 0 || strings.Contains(version, "nightly")
}

// PDSupportMicroServicesWithName return if the given version of PD supports micro services with name.
func PDSupportMicroServicesWithName(version string) bool {
// PDSupportMicroservicesWithName return if the given version of PD supports microservices with name.
func PDSupportMicroservicesWithName(version string) bool {
return semver.Compare(version, "v8.3.0") >= 0 || strings.Contains(version, "nightly")
}

Expand Down

0 comments on commit f57aa1d

Please sign in to comment.