Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch flag definitions to be on pflag instead of flag in package go/vt/servenv #11144

Closed
ajm188 opened this issue Aug 31, 2022 · 0 comments · Fixed by #11190
Closed

Switch flag definitions to be on pflag instead of flag in package go/vt/servenv #11144

ajm188 opened this issue Aug 31, 2022 · 0 comments · Fixed by #11190
Assignees
Labels
Component: CLI Component: General Changes throughout the code base Type: Enhancement Logical improvement (somewhere between a bug and feature) Type: Internal Cleanup

Comments

@ajm188
Copy link
Contributor

ajm188 commented Aug 31, 2022

Part of #10697.

Current flags:

$ git grep -E "\bflag\.[A-Z]" -- go/vt/servenv/*.go
go/vt/servenv/buildinfo.go:     Version = flag.Bool("version", false, "print binary version")
go/vt/servenv/grpc_server.go:   GRPCPort = flag.Int("grpc_port", 0, "Port to listen on for gRPC calls")
go/vt/servenv/grpc_server.go:   GRPCCert = flag.String("grpc_cert", "", "server certificate to use for gRPC connections, requires grpc_key, enables TLS")
go/vt/servenv/grpc_server.go:   GRPCKey = flag.String("grpc_key", "", "server private key to use for gRPC connections, requires grpc_cert, enables TLS")
go/vt/servenv/grpc_server.go:   GRPCCA = flag.String("grpc_ca", "", "server CA to use for gRPC connections, requires TLS, and enforces client certificate check")
go/vt/servenv/grpc_server.go:   GRPCCRL = flag.String("grpc_crl", "", "path to a certificate revocation list in PEM format, client certificates will be further verified against this file during TLS handshake")
go/vt/servenv/grpc_server.go:   GRPCEnableOptionalTLS = flag.Bool("grpc_enable_optional_tls", false, "enable optional TLS mode when a server accepts both TLS and plain-text connections on the same port")
go/vt/servenv/grpc_server.go:   GRPCServerCA = flag.String("grpc_server_ca", "", "path to server CA in PEM format, which will be combine with server cert, return full certificate chain to clients")
go/vt/servenv/grpc_server.go:   GRPCAuth = flag.String("grpc_auth_mode", "", "Which auth plugin implementation to use (eg: static)")
go/vt/servenv/grpc_server.go:   GRPCMaxConnectionAge = flag.Duration("grpc_max_connection_age", time.Duration(math.MaxInt64), "Maximum age of a client connection before GoAway is sent.")
go/vt/servenv/grpc_server.go:   GRPCMaxConnectionAgeGrace = flag.Duration("grpc_max_connection_age_grace", time.Duration(math.MaxInt64), "Additional grace period after grpc_max_connection_age, after which connections are forcibly closed.")
go/vt/servenv/grpc_server.go:   GRPCInitialConnWindowSize = flag.Int("grpc_server_initial_conn_window_size", 0, "gRPC server initial connection window size")
go/vt/servenv/grpc_server.go:   GRPCInitialWindowSize = flag.Int("grpc_server_initial_window_size", 0, "gRPC server initial window size")
go/vt/servenv/grpc_server.go:   GRPCKeepAliveEnforcementPolicyMinTime = flag.Duration("grpc_server_keepalive_enforcement_policy_min_time", 10*time.Second, "gRPC server minimum keepalive time")
go/vt/servenv/grpc_server.go:   GRPCKeepAliveEnforcementPolicyPermitWithoutStream = flag.Bool("grpc_server_keepalive_enforcement_policy_permit_without_stream", false, "gRPC server permit client keepalive pings even when there are no active streams (RPCs)")
go/vt/servenv/grpc_server_auth_mtls.go: ClientCertSubstrings = flag.String("grpc_auth_mtls_allowed_substrings", "", "List of substrings of at least one of the client certificate names (separated by colon).")
go/vt/servenv/grpc_server_auth_static.go:       credsFile = flag.String("grpc_auth_static_password_file", "", "JSON File to read the users/passwords from.")
go/vt/servenv/mysql.go:var MySQLServerVersion = flag.String("mysql_server_version", "", "MySQL server version to advertise.")
go/vt/servenv/pid_file.go:var pidFile = flag.String("pid_file", "", "If set, the process will write its pid to the named file, and delete it on graceful shutdown.")
go/vt/servenv/pprof.go: _         = flag.String("cpu_profile", "", "deprecated: use '-pprof=cpu' instead")
go/vt/servenv/pprof.go: pprofFlag = flag.String("pprof", "", "enable profiling")
go/vt/servenv/pprof_test.go:    flag.Set("pprof", "cpu,waitSig")
go/vt/servenv/pprof_test.go:    flag.Set("pprof", "cpu")
go/vt/servenv/servenv.go:// After a server program has called flag.Parse, it needs to call
go/vt/servenv/servenv.go:       lameduckPeriod = flag.Duration("lameduck-period", 50*time.Millisecond, "keep running at least this long after SIGTERM before stopping")
go/vt/servenv/servenv.go:       onTermTimeout  = flag.Duration("onterm_timeout", 10*time.Second, "wait no more than this for OnTermSync handlers before stopping")
go/vt/servenv/servenv.go:       onCloseTimeout = flag.Duration("onclose_timeout", time.Nanosecond, "wait no more than this for OnClose handlers before stopping")
go/vt/servenv/servenv.go:       _              = flag.Int("mem-profile-rate", 512*1024, "deprecated: use '-pprof=mem' instead")
go/vt/servenv/servenv.go:       _              = flag.Int("mutex-profile-fraction", 0, "deprecated: use '-pprof=mutex' instead")
go/vt/servenv/servenv.go:       catchSigpipe   = flag.Bool("catch-sigpipe", false, "catch and ignore SIGPIPE on stdout and stderr if specified")
go/vt/servenv/servenv.go:       Port = flag.Int("port", 0, "port for the server")
go/vt/servenv/servenv.go:               flag.Usage()
go/vt/servenv/service_map.go:   flag.Var(&serviceMapFlag, "service_map", "comma separated list of services to enable (or disable if prefixed with '-') Example: grpc-queryservice")
go/vt/servenv/unix_socket.go:   SocketFile = flag.String("socket_file", "", "Local unix socket file to listen on")
@ajm188 ajm188 self-assigned this Aug 31, 2022
@ajm188 ajm188 added Type: Internal Cleanup Type: Enhancement Logical improvement (somewhere between a bug and feature) Component: General Changes throughout the code base Component: CLI labels Aug 31, 2022
ajm188 pushed a commit to planetscale/vitess that referenced this issue Aug 31, 2022
…flag`

Relates to vitessio#11144.

Signed-off-by: Andrew Mason <andrew@planetscale.com>
ajm188 pushed a commit that referenced this issue Sep 1, 2022
…flag` (#11146)

* [cli] [servenv] Migrate grpc auth server flags within `servenv` to `pflag`

Relates to #11144.

Signed-off-by: Andrew Mason <andrew@planetscale.com>

* fix flag hack for vttestserver tests

Signed-off-by: Andrew Mason <andrew@planetscale.com>
ajm188 pushed a commit to planetscale/vitess that referenced this issue Sep 7, 2022
Relates to vitessio#11144.

Also converts the flag from our custom `StringListValue` to pflag-native
`StringSlice`.

Signed-off-by: Andrew Mason <andrew@planetscale.com>
ajm188 pushed a commit to planetscale/vitess that referenced this issue Sep 7, 2022
Relates to vitessio#11144.

Signed-off-by: Andrew Mason <andrew@planetscale.com>
ajm188 pushed a commit that referenced this issue Sep 7, 2022
…11179)

* unexport CheckServiceMap

Signed-off-by: Andrew Mason <andrew@planetscale.com>

* [cli] [servenv] Migrate `service_map` to pflag

Relates to #11144.

Also converts the flag from our custom `StringListValue` to pflag-native
`StringSlice`.

Signed-off-by: Andrew Mason <andrew@planetscale.com>

* [cli] [servenv] Migrate `pprof` flag to `pflag`

Relates to #11144.

Signed-off-by: Andrew Mason <andrew@planetscale.com>

* fix tests

Signed-off-by: Andrew Mason <andrew@planetscale.com>
ajm188 pushed a commit to planetscale/vitess that referenced this issue Sep 7, 2022
Relates to vitessio#11144.

Signed-off-by: Andrew Mason <andrew@planetscale.com>
ajm188 pushed a commit to planetscale/vitess that referenced this issue Sep 7, 2022
Relates to vitessio#11144.

Signed-off-by: Andrew Mason <andrew@planetscale.com>
ajm188 pushed a commit to planetscale/vitess that referenced this issue Sep 7, 2022
Relates to vitessio#11144.

Signed-off-by: Andrew Mason <andrew@planetscale.com>
ajm188 pushed a commit that referenced this issue Sep 8, 2022
* [cli] [servenv] Migrate `--socket_file` flag to pflag and un-export

Relates to #11144.

Signed-off-by: Andrew Mason <andrew@planetscale.com>

* [cli] [servenv] Migrate `--pid_file` flag to pflag

Relates to #11144.

Signed-off-by: Andrew Mason <andrew@planetscale.com>

* [cli] [servenv] Correct old flag.Usage call

Relates to #11144.

Signed-off-by: Andrew Mason <andrew@planetscale.com>
ajm188 pushed a commit to planetscale/vitess that referenced this issue Sep 8, 2022
Relates to vitessio#11144.

Signed-off-by: Andrew Mason <andrew@planetscale.com>
ajm188 pushed a commit that referenced this issue Sep 8, 2022
…tctldclient` and `vtadmin` (#11189)

* unexport servenv.Version

Signed-off-by: Andrew Mason <andrew@planetscale.com>

* [cli] [servenv] Migrate `--version` flag to pflag

Relates to #11144.

Signed-off-by: Andrew Mason <andrew@planetscale.com>

* [cli] [vtadmin|vtctldclient] Add `--version` flags to cobra commands

Closes #10909.

Signed-off-by: Andrew Mason <andrew@planetscale.com>
ajm188 pushed a commit to planetscale/vitess that referenced this issue Sep 8, 2022
Closes vitessio#11144.

Signed-off-by: Andrew Mason <andrew@planetscale.com>
ajm188 pushed a commit that referenced this issue Sep 9, 2022
* [sqlparser] Use interoperable flag.Parsed function

Signed-off-by: Andrew Mason <andrew@planetscale.com>

* [cli] [servenv] Migrate `--mysql_server_version` flag to pflag

Closes #11144.

Signed-off-by: Andrew Mason <andrew@planetscale.com>

* no mysql_server_version for vtorc

Signed-off-by: Andrew Mason <andrew@planetscale.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: CLI Component: General Changes throughout the code base Type: Enhancement Logical improvement (somewhere between a bug and feature) Type: Internal Cleanup
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant