Граф коммитов

14 Коммитов

Автор SHA1 Сообщение Дата
Andrew Mason c3f4a998b2
[cmd/*] Switch to pflag for all CLI flag parsing (#10619)
* Switch to `pflag` for all parsing

This transparently swaps the cli parsing library used by `internal/flag`
from the standard library `flag` package to `spf13/pflag`.

It also introduces hook points for packages throughout the vitess codebase
to register their flags for either all commands using `servenv` or a
particular subset of commands. This allows these packages to continue to
define their flag variables in a package-private way, but without
polluting the global flagset.

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

* Workaround exit code difference between stdlib `flag` and `pflag`

tl;dr stdlib `flag` has [this][1] and `pflag` does not

[1]: dcf0929de6

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

* adjust test data for difference in spacing between pflag/stdflag

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

* update lingering legacy flag tests

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

* Update vtgate/tabletgateway.go to use new interface to isolate flags, update test data

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

* update flags in java test code

Signed-off-by: Andrew Mason <andrew@planetscale.com>
2022-07-25 15:12:09 -04:00
Andrew Mason 8fde81bc42
[VEP-4, phase 1] Flag Deprecation Warnings (#9733)
* Add helper function to issue deprecation warnings when parsing flags

This package is internal, and extremely temporary. After the
necessary backwards-compatability deprecation cycle to switch to
`pflag`, will be removed.

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

* Update `cmd` callsites that don't parse via `servenv` to use deprecation-aware parser

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

* Override `Usage` func to show flags with double-dashes in `-h` output

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

* Extract and rework the deprecation warning text, plus a little cleaner structure

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

* Fixup import ordering for `context` while I'm here

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

* Handle positional arguments to filter out the double-dash for backwards compatibility

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

* Refactor to support subflag usages and custom usage funcs

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

* Add ability to filter out certain flags from the Usage

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

* Documentation for SetUsage nonsense

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

* Override custom Usages, preserving intended effects

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

* Special consideration for v1 reshard workflow cli

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

* Update flags in tests

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

* Filter out double-dash separator when running `vtctl`/`vtctlclient` <= v13.0.0

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

* Add release notes for CLI deprecations with advice

Signed-off-by: Andrew Mason <andrew@planetscale.com>
2022-03-08 14:27:31 -08:00
akilan 5aa4709675 Handled ineffectual errors
Signed-off-by: akilan <as251@hw.ac.uk>
2020-06-23 23:03:24 +04:00
yuxiaobo 03e83d6c30 add license in /go file
Signed-off-by: yuxiaobo <yuxiaobogo@163.com>
2019-10-21 22:30:02 +08:00
deepthi c858a37c21 cmd package
Signed-off-by: deepthi <deepthi@planetscale.com>
2019-03-07 11:13:54 -08:00
David Weitzman 6ccbb93414 Remove influxdb as a push backend
The code seems to be out of date, unmaintained, and incompatible with current versions of influx and recent versions of the influx golang client.

Signed-off-by: David Weitzman <dweitzman@pinterest.com>
2019-01-07 18:05:07 -08:00
David Weitzman e6b1e31439 Factor out glog references for ease of dropping in an adapter to a different logging library.
Note: This is the revert of a temporary revert and has the same effect
as the original PR: https://github.com/vitessio/vitess/pull/3830

Revert "Revert "Factor out glog references""

This reverts commit 246e2898d2.

Signed-off-by: David Weitzman <dweitzman@pinterest.com>
2018-04-20 19:40:15 -07:00
Michael Berlin 246e2898d2 Revert "Factor out glog references"
Signed-off-by: Michael Berlin <mberlin@google.com>
2018-04-20 16:44:06 -07:00
David Weitzman b0cedf1b09 Factor out glog references for ease of dropping in an adapter to a different logging library.
Signed-off-by: David Weitzman <dweitzman@pinterest.com>
2018-04-17 08:56:51 -07:00
Anthony Yeh 6914580ad5
Rewrite imports to new custom URL.
This commit consists only of the changes from running the following:

```
find go -name '*.go' | xargs -n 10 -- sed -i -r -e \
  's,"github.com/youtube/vitess/go/,"vitess.io/vitess/go/,'
```
2018-02-27 12:00:33 -08:00
Alain Jobart cecb9bbed5 Removing old ZK code.
The only part of go/zk we were still using is go/zk/zkctl.
Moved it to go/vt/zkctl.

Removed the rest of go/zk code. The config part (ZK_CLIENT_CONF json
config) was moved to CellInfo.The Metaconn part was moved to the topo
service code (for the cell map) and to zk2topo (for the ZkConn retrying
part).

Note re-running bootstrap.sh is required here, as the path for zksrv.sh
has changed.
2017-12-13 14:41:32 -08:00
Sugu Sougoumarane 7af23e1dde license: BSD->Apache v2.0
Please refer to #2694 and #2670 for motivation and reasoning for
this change.

I've tried to follow best practice in inserting the copyright
headers. In other open source projects, not all files carry
the notice. For example documentation doesn't. I've followed
similar ground rules.

I did not change the php because there is a separate LICENSE
file there by Pixel Federation. We'll first need to notify
them our intent before changing anything there.

As for the presubmit check, it's going to be non-trivial
because of the number of exceptions, like file types,
directories and generated code. So, it will have to be
a separate project.
2017-05-06 00:38:56 -07:00
Ammar Aijazi 427f582116 Support for emitting stats push-based monitoring backends, with initial
support for InfluxDB (v0.88).
2015-03-12 18:22:21 -07:00
Anthony Yeh d6476f97e3 Move daemon mode from zkctl to zkctld.
This matches the mysqlctld model. When zkctld starts, it performs either
"init" or "start" as necessary. This allows the scheduler to recover the
task by restarting it, without having to purge the data dir.
2014-10-28 12:59:06 -07:00