Skip to content

Commit

Permalink
change to name
Browse files Browse the repository at this point in the history
Signed-off-by: husharp <[email protected]>
  • Loading branch information
HuSharp committed May 13, 2024
1 parent dd72b9c commit a39300e
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions cmd/pd-server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ func NewTSOServiceCommand() *cobra.Command {
Short: "Run the TSO service",
Run: tso.CreateServerWrapper,
}
cmd.Flags().StringP("name", "", "", "human-readable name for this TSO member")
cmd.Flags().BoolP("version", "V", false, "print version information and exit")
cmd.Flags().StringP("config", "", "", "config file")
cmd.Flags().StringP("backend-endpoints", "", "", "url for etcd client")
Expand All @@ -114,6 +115,7 @@ func NewSchedulingServiceCommand() *cobra.Command {
Short: "Run the scheduling service",
Run: scheduling.CreateServerWrapper,
}
cmd.Flags().StringP("name", "", "", "human-readable name for this Scheduling member")
cmd.Flags().BoolP("version", "V", false, "print version information and exit")
cmd.Flags().StringP("config", "", "", "config file")
cmd.Flags().StringP("backend-endpoints", "", "", "url for etcd client")
Expand All @@ -134,6 +136,7 @@ func NewResourceManagerServiceCommand() *cobra.Command {
Short: "Run the resource manager service",
Run: resource_manager.CreateServerWrapper,
}
cmd.Flags().StringP("name", "", "", "human-readable name for this resource management member")
cmd.Flags().BoolP("version", "V", false, "print version information and exit")
cmd.Flags().StringP("config", "", "", "config file")
cmd.Flags().StringP("backend-endpoints", "", "", "url for etcd client")
Expand Down
2 changes: 1 addition & 1 deletion pkg/mcs/discovery/discover.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func TransferPrimary(client *clientv3.Client, serviceName, oldPrimary, newPrimar
var primaryIDs []string
var secondaryValues []string
for _, member := range entries {
if (newPrimary == "" && member.ServiceAddr != oldPrimary) || (newPrimary != "" && member.ServiceAddr == newPrimary) {
if (newPrimary == "" && member.ServiceAddr != oldPrimary) || (newPrimary != "" && member.Name == newPrimary) {
primaryIDs = append(primaryIDs, member.ServiceAddr)
if string(member.MemberValue) == "" {
return errors.New("member value is empty")
Expand Down
1 change: 1 addition & 0 deletions pkg/mcs/resourcemanager/server/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ func (c *Config) Parse(flagSet *pflag.FlagSet) error {
}

// Ignore the error check here
configutil.AdjustCommandLineString(flagSet, &c.Name, "name")
configutil.AdjustCommandLineString(flagSet, &c.Log.Level, "log-level")
configutil.AdjustCommandLineString(flagSet, &c.Log.File.Filename, "log-file")
configutil.AdjustCommandLineString(flagSet, &c.Metric.PushAddress, "metrics-addr")
Expand Down
1 change: 1 addition & 0 deletions pkg/mcs/scheduling/server/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ func (c *Config) Parse(flagSet *pflag.FlagSet) error {
}

// Ignore the error check here
configutil.AdjustCommandLineString(flagSet, &c.Name, "name")
configutil.AdjustCommandLineString(flagSet, &c.Log.Level, "log-level")
configutil.AdjustCommandLineString(flagSet, &c.Log.File.Filename, "log-file")
configutil.AdjustCommandLineString(flagSet, &c.Metric.PushAddress, "metrics-addr")
Expand Down
1 change: 1 addition & 0 deletions pkg/mcs/tso/server/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ func (c *Config) Parse(flagSet *pflag.FlagSet) error {
}

// Ignore the error check here
configutil.AdjustCommandLineString(flagSet, &c.Name, "name")
configutil.AdjustCommandLineString(flagSet, &c.Log.Level, "log-level")
configutil.AdjustCommandLineString(flagSet, &c.Log.File.Filename, "log-file")
configutil.AdjustCommandLineString(flagSet, &c.Metric.PushAddress, "metrics-addr")
Expand Down

0 comments on commit a39300e

Please sign in to comment.