Skip to content

Commit

Permalink
fix: support specifying username/password for redis holding manifests…
Browse files Browse the repository at this point in the history
… in argocd-server (argoproj#16786)

Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
Signed-off-by: penglongli <pelenli@tencent.com>
  • Loading branch information
alexmt authored and penglongli committed Mar 6, 2024
1 parent 856461b commit c620701
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions util/cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,14 @@ func AddCacheFlagsToCmd(cmd *cobra.Command, opts ...Options) func() (*Cache, err
}
password := os.Getenv(envRedisPassword)
username := os.Getenv(envRedisUsername)
if opt.FlagPrefix != "" {
if val := os.Getenv(opt.getEnvPrefix() + envRedisUsername); val != "" {
username = val
}
if val := os.Getenv(opt.getEnvPrefix() + envRedisPassword); val != "" {
password = val
}
}
maxRetries := env.ParseNumFromEnv(envRedisRetryCount, defaultRedisRetryCount, 0, math.MaxInt32)
compression, err := CompressionTypeFromString(compressionStr)
if err != nil {
Expand Down

0 comments on commit c620701

Please sign in to comment.