Skip to content

Commit c6e583e

Browse files
Migrate vtgate and vttablet flags to dash format
1 parent 15e2018 commit c6e583e

File tree

5 files changed

+9
-6
lines changed

5 files changed

+9
-6
lines changed

go/cmd/vttablet/cli/cli.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import (
3636
"vitess.io/vitess/go/vt/tableacl/simpleacl"
3737
"vitess.io/vitess/go/vt/topo"
3838
"vitess.io/vitess/go/vt/topo/topoproto"
39+
"vitess.io/vitess/go/vt/utils"
3940
"vitess.io/vitess/go/vt/vtenv"
4041
"vitess.io/vitess/go/vt/vttablet/tabletmanager"
4142
"vitess.io/vitess/go/vt/vttablet/tabletmanager/semisyncmonitor"
@@ -274,5 +275,5 @@ func init() {
274275
Main.Flags().StringVar(&tableACLConfig, "table-acl-config", tableACLConfig, "path to table access checker config file; send SIGHUP to reload this file")
275276
Main.Flags().DurationVar(&tableACLConfigReloadInterval, "table-acl-config-reload-interval", tableACLConfigReloadInterval, "Ticker to reload ACLs. Duration flag, format e.g.: 30s. Default: do not reload")
276277
Main.Flags().StringVar(&tabletPath, "tablet-path", tabletPath, "tablet alias")
277-
Main.Flags().StringVar(&tabletConfig, "tablet_config", tabletConfig, "YAML file config for tablet")
278+
utils.SetFlagStringVar(Main.Flags(), &tabletConfig, "tablet-config", tabletConfig, "YAML file config for tablet")
278279
}

go/vt/vtgate/buffer/flags.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ var (
4444
)
4545

4646
func registerFlags(fs *pflag.FlagSet) {
47-
fs.BoolVar(&bufferEnabled, "enable_buffer", false, "Enable buffering (stalling) of primary traffic during failovers.")
47+
utils.SetFlagBoolVar(fs, &bufferEnabled, "enable-buffer", false, "Enable buffering (stalling) of primary traffic during failovers.")
4848
utils.SetFlagBoolVar(fs, &bufferEnabledDryRun, "enable-buffer-dry-run", false, "Detect and log failover events, but do not actually buffer requests.")
4949

5050
utils.SetFlagDurationVar(fs, &bufferWindow, "buffer-window", 10*time.Second, "Duration for how long a request should be buffered at most.")

go/vt/vtgate/executor.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ import (
5353
"vitess.io/vitess/go/vt/servenv"
5454
"vitess.io/vitess/go/vt/sqlparser"
5555
"vitess.io/vitess/go/vt/srvtopo"
56+
"vitess.io/vitess/go/vt/utils"
5657
"vitess.io/vitess/go/vt/sysvars"
5758
"vitess.io/vitess/go/vt/topo/topoproto"
5859
"vitess.io/vitess/go/vt/vtenv"
@@ -93,7 +94,7 @@ const (
9394

9495
func init() {
9596
registerTabletTypeFlag := func(fs *pflag.FlagSet) {
96-
fs.Var((*topoproto.TabletTypeFlag)(&defaultTabletType), "default_tablet_type", "The default tablet type to set for queries, when one is not explicitly selected.")
97+
utils.SetFlagVar(fs, (*topoproto.TabletTypeFlag)(&defaultTabletType), "default-tablet-type", "The default tablet type to set for queries, when one is not explicitly selected.")
9798
}
9899

99100
servenv.OnParseFor("vtgate", registerTabletTypeFlag)

go/vt/vtgate/tabletgateway.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ var (
6868

6969
func init() {
7070
servenv.OnParseFor("vtgate", func(fs *pflag.FlagSet) {
71-
fs.StringVar(&CellsToWatch, "cells_to_watch", "", "comma-separated list of cells for watching tablets")
71+
utils.SetFlagStringVar(fs, &CellsToWatch, "cells-to-watch", "", "comma-separated list of cells for watching tablets")
7272
utils.SetFlagDurationVar(fs, &initialTabletTimeout, "gateway-initial-tablet-timeout", 30*time.Second, "At startup, the tabletGateway will wait up to this duration to get at least one tablet per keyspace/shard/tablet type")
7373
fs.IntVar(&retryCount, "retry-count", 2, "retry count")
7474
fs.BoolVar(&balancerEnabled, "enable-balancer", false, "Enable the tablet balancer to evenly spread query load for a given tablet type")

go/vt/vttablet/customrule/topocustomrule/topocustomrule.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import (
3232
"vitess.io/vitess/go/vt/log"
3333
"vitess.io/vitess/go/vt/servenv"
3434
"vitess.io/vitess/go/vt/topo"
35+
"vitess.io/vitess/go/vt/utils"
3536
"vitess.io/vitess/go/vt/vttablet/tabletserver"
3637
"vitess.io/vitess/go/vt/vttablet/tabletserver/rules"
3738
)
@@ -43,8 +44,8 @@ var (
4344
)
4445

4546
func registerFlags(fs *pflag.FlagSet) {
46-
fs.StringVar(&ruleCell, "topocustomrule_cell", ruleCell, "topo cell for customrules file.")
47-
fs.StringVar(&rulePath, "topocustomrule_path", rulePath, "path for customrules file. Disabled if empty.")
47+
utils.SetFlagStringVar(fs, &ruleCell, "topocustomrule-cell", ruleCell, "topo cell for customrules file.")
48+
utils.SetFlagStringVar(fs, &rulePath, "topocustomrule-path", rulePath, "path for customrules file. Disabled if empty.")
4849
}
4950

5051
func init() {

0 commit comments

Comments
 (0)