diff --git a/go.mod b/go.mod index 6c5fad8e6..dfdd1c737 100644 --- a/go.mod +++ b/go.mod @@ -28,7 +28,7 @@ require ( github.com/fsnotify/fsnotify v1.6.0 github.com/go-redsync/redsync/v4 v4.8.1 github.com/golang/protobuf v1.5.3 - github.com/gomodule/redigo v2.0.1-0.20191111085604-09d84710e01a+incompatible + github.com/gomodule/redigo v1.9.2 github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.2 github.com/pkg/errors v0.9.1 diff --git a/go.sum b/go.sum index 7ee20a115..3c742d4eb 100644 --- a/go.sum +++ b/go.sum @@ -202,8 +202,8 @@ github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/gomodule/redigo v1.7.1-0.20190322064113-39e2c31b7ca3/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= github.com/gomodule/redigo v1.8.2/go.mod h1:P9dn9mFrCBvWhGE1wpxx6fgq7BAeLBk+UUUzlpkBYO0= -github.com/gomodule/redigo v2.0.1-0.20191111085604-09d84710e01a+incompatible h1:1mCVU17Wc8oyVUlx1ZXpnWz1DNP6v0R5z5ElKCTvVrY= -github.com/gomodule/redigo v2.0.1-0.20191111085604-09d84710e01a+incompatible/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= +github.com/gomodule/redigo v1.9.2 h1:HrutZBLhSIU8abiSfW8pj8mPhOyMYjZT/wcA4/L9L9s= +github.com/gomodule/redigo v1.9.2/go.mod h1:KsU3hiK/Ay8U42qpaJk+kuNa3C+spxapWpM+ywhcgtw= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= diff --git a/install/helm/open-match/templates/_helpers.tpl b/install/helm/open-match/templates/_helpers.tpl index 80e39112f..0e025cb31 100644 --- a/install/helm/open-match/templates/_helpers.tpl +++ b/install/helm/open-match/templates/_helpers.tpl @@ -112,9 +112,13 @@ resources: {{- if .Values.redis.auth.enabled }} - name: redis-password secret: +{{- if .Values.redis.secretName }} + secretName: {{ .Values.redis.secretName }} +{{- else }} secretName: {{ include "call-nested" (list . "redis" "common.names.fullname") }} {{- end -}} {{- end -}} +{{- end -}} {{- define "openmatch.labels.nodegrouping" -}} {{- if .Values.global.kubernetes.affinity }} diff --git a/internal/statestore/redis.go b/internal/statestore/redis.go index 8910c1890..649d3df15 100644 --- a/internal/statestore/redis.go +++ b/internal/statestore/redis.go @@ -17,7 +17,8 @@ package statestore import ( "context" "fmt" - "io/ioutil" + "net/url" + "os" "time" rs "github.com/go-redsync/redsync/v4" @@ -228,11 +229,12 @@ func redisURLFromAddr(addr string, cfg config.View, usePassword bool) string { if usePassword { passwordFile := cfg.GetString("redis.passwordPath") redisLogger.Debugf("loading Redis password from file %s", passwordFile) - passwordData, err := ioutil.ReadFile(passwordFile) + passwordData, err := os.ReadFile(passwordFile) if err != nil { redisLogger.Fatalf("cannot read Redis password from file %s, desc: %s", passwordFile, err.Error()) } - redisURL += fmt.Sprintf("%s:%s@", cfg.GetString("redis.user"), string(passwordData)) + redisUser := url.QueryEscape(cfg.GetString("redis.user")) + redisURL += fmt.Sprintf("%s:%s@", redisUser, url.QueryEscape(string(passwordData))) } return redisURL + addr