From f1d37e74ef13a63108e86bc15bbaf8e648c715b7 Mon Sep 17 00:00:00 2001 From: xuriwuyun Date: Mon, 19 Aug 2024 17:10:13 +0800 Subject: [PATCH] chore: update redis envs --- engines/redis/manager.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/engines/redis/manager.go b/engines/redis/manager.go index 646314c..e08b793 100644 --- a/engines/redis/manager.go +++ b/engines/redis/manager.go @@ -32,6 +32,11 @@ import ( "github.com/apecloud/dbctl/engines" ) +const ( + EnvRootUser = "REDIS_DEFAULT_USER" + EnvRootPasswd = "REDIS_DEFAULT_PASSWORD" +) + var ( redisUser = "default" redisPasswd = "" @@ -58,10 +63,14 @@ func NewManager(properties engines.Properties) (engines.DBManager, error) { if viper.IsSet(constant.KBEnvServiceUser) { redisUser = viper.GetString(constant.KBEnvServiceUser) + } else if viper.IsSet(EnvRootUser) { + redisUser = viper.GetString(EnvRootUser } if viper.IsSet(constant.KBEnvServicePassword) { redisPasswd = viper.GetString(constant.KBEnvServicePassword) + } else if viper.IsSet(EnvRootPasswd) { + redisPasswd = viper.GetString(EnvRootPasswd) } managerBase, err := engines.NewDBManagerBase(logger)