Skip to content

Commit

Permalink
chore: update redis envs
Browse files Browse the repository at this point in the history
  • Loading branch information
xuriwuyun committed Aug 19, 2024
1 parent 287b13b commit f1d37e7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions engines/redis/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ import (
"github.com/apecloud/dbctl/engines"
)

const (
EnvRootUser = "REDIS_DEFAULT_USER"
EnvRootPasswd = "REDIS_DEFAULT_PASSWORD"
)

var (
redisUser = "default"
redisPasswd = ""
Expand All @@ -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)
Expand Down

0 comments on commit f1d37e7

Please sign in to comment.