Skip to content

Commit

Permalink
tools: support get all groups (tikv#6714)
Browse files Browse the repository at this point in the history
ref tikv#5895, ref tikv#6706

Signed-off-by: Ryan Leung <rleungx@gmail.com>
  • Loading branch information
rleungx committed Aug 2, 2023
1 parent 7c6cc4f commit 2f5eccb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
16 changes: 9 additions & 7 deletions tools/pd-ctl/pdctl/command/keyspace_group_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,15 @@ func showKeyspaceGroupsCommandFunc(cmd *cobra.Command, args []string) {
cmd.Printf("Failed to get state: %s\n", err)
}
stateValue := ""
state = strings.ToLower(state)
switch state {
case "merge", "split":
stateValue = fmt.Sprintf("state=%v", state)
default:
cmd.Println("Unknown state: " + state)
return
if len(state) != 0 {
state = strings.ToLower(state)
switch state {
case "merge", "split":
stateValue = fmt.Sprintf("state=%v", state)
default:
cmd.Println("Unknown state: " + state)
return
}
}

if len(stateValue) != 0 {
Expand Down
1 change: 0 additions & 1 deletion tools/pd-ctl/pdctl/command/store_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,6 @@ func labelStoreCommandFunc(cmd *cobra.Command, args []string) {
} else if rewrite, _ := cmd.Flags().GetBool("rewrite"); rewrite {
prefix += "?force=true"
}
cmd.Println(prefix)
postJSON(cmd, prefix, labels)
}

Expand Down

0 comments on commit 2f5eccb

Please sign in to comment.