From 3a677b45ac118a3826b2cbadda7f80d5fe6ebb57 Mon Sep 17 00:00:00 2001 From: Frank Meier Date: Thu, 28 Feb 2019 10:59:06 +0100 Subject: [PATCH] reintroduce REDISCLI_CLUSTER_YES env variable in redis-cli the variable was introduced only in the 5.0 branch in #5879 bc6c1c40db (cherry picked from commit 51077c821236eba5223b1e624f2462214a0e5062) --- src/redis-cli.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/redis-cli.c b/src/redis-cli.c index 0148964bf..ec7153d15 100644 --- a/src/redis-cli.c +++ b/src/redis-cli.c @@ -73,6 +73,7 @@ #define REDIS_CLI_RCFILE_ENV "REDISCLI_RCFILE" #define REDIS_CLI_RCFILE_DEFAULT ".redisclirc" #define REDIS_CLI_AUTH_ENV "REDISCLI_AUTH" +#define REDIS_CLI_CLUSTER_YES_ENV "REDISCLI_CLUSTER_YES" #define CLUSTER_MANAGER_SLOTS 16384 #define CLUSTER_MANAGER_MIGRATE_TIMEOUT 60000 @@ -1668,6 +1669,11 @@ static void parseEnv() { if (auth != NULL && config.auth == NULL) { config.auth = auth; } + + char *cluster_yes = getenv(REDIS_CLI_CLUSTER_YES_ENV); + if (cluster_yes != NULL && !strcmp(cluster_yes, "1")) { + config.cluster_manager_command.flags |= CLUSTER_MANAGER_CMD_FLAG_YES; + } } static sds readArgFromStdin(void) {