diff --git a/examples/common/env.sh b/examples/common/env.sh index adee0f34d3f..2b7c3ac7026 100644 --- a/examples/common/env.sh +++ b/examples/common/env.sh @@ -30,6 +30,11 @@ for binary in mysqld etcd etcdctl curl vtctlclient vttablet vtgate vtctld mysqlc command -v "$binary" > /dev/null || fail "${binary} is not installed in PATH. See https://vitess.io/docs/get-started/local/ for install instructions." done; +# vtctlclient has a separate alias setup below +for binary in vttablet vtgate vtctld mysqlctl vtorc vtctl; do + alias $binary="$binary --config-file-not-found-handling=ignore" +done; + if [ "${TOPO}" = "zk2" ]; then # Each ZooKeeper server needs a list of all servers in the quorum. # Since we're running them all locally, we need to give them unique ports. @@ -79,7 +84,7 @@ mkdir -p "${VTDATAROOT}/tmp" # such as ~/.my.cnf alias mysql="command mysql --no-defaults -h 127.0.0.1 -P 15306" -alias vtctlclient="command vtctlclient --server localhost:15999 --log_dir ${VTDATAROOT}/tmp --alsologtostderr" +alias vtctlclient="command vtctlclient --server localhost:15999 --log_dir ${VTDATAROOT}/tmp --alsologtostderr --config-file-not-found-handling=ignore" alias vtctldclient="command vtctldclient --server localhost:15999" # Make sure aliases are expanded in non-interactive shell diff --git a/examples/local/401_teardown.sh b/examples/local/401_teardown.sh index 08dcbf3cd29..ab93f453668 100755 --- a/examples/local/401_teardown.sh +++ b/examples/local/401_teardown.sh @@ -26,7 +26,7 @@ source ../common/env.sh ../common/scripts/vtgate-down.sh for tablet in 100 200 300 400; do - if vtctlclient --action_timeout 1s --server localhost:15999 GetTablet zone1-$tablet >/dev/null 2>&1; then + if vtctldclient --action_timeout 1s --server localhost:15999 GetTablet zone1-$tablet >/dev/null 2>&1; then # The zero tablet is up. Try to shutdown 0-2 tablet + mysqlctl for i in 0 1 2; do uid=$((tablet + i)) diff --git a/go/viperutil/config.go b/go/viperutil/config.go index 5d00f68a51a..49e3f960875 100644 --- a/go/viperutil/config.go +++ b/go/viperutil/config.go @@ -69,8 +69,9 @@ var ( configFileNotFoundHandling = Configure( "config.notfound.handling", Options[ConfigFileNotFoundHandling]{ - Default: WarnOnConfigFileNotFound, - GetFunc: getHandlingValue, + Default: WarnOnConfigFileNotFound, + GetFunc: getHandlingValue, + FlagName: "config-file-not-found-handling", }, ) configPersistenceMinInterval = Configure( @@ -110,7 +111,7 @@ func RegisterFlags(fs *pflag.FlagSet) { var h = configFileNotFoundHandling.Default() fs.Var(&h, "config-file-not-found-handling", fmt.Sprintf("Behavior when a config file is not found. (Options: %s)", strings.Join(handlingNames, ", "))) - BindFlags(fs, configPaths, configType, configName, configFile) + BindFlags(fs, configPaths, configType, configName, configFile, configFileNotFoundHandling, configPersistenceMinInterval) } // LoadConfig attempts to find, and then load, a config file for viper-backed