diff --git a/library/common/Chart.yaml b/library/common/Chart.yaml index 1d9e680e..8fca2241 100644 --- a/library/common/Chart.yaml +++ b/library/common/Chart.yaml @@ -15,4 +15,4 @@ maintainers: name: common sources: null type: library -version: 14.0.6 +version: 14.0.7 diff --git a/library/common/templates/lib/dependencies/_redisInjector.tpl b/library/common/templates/lib/dependencies/_redisInjector.tpl index 68601649..e4a6dbec 100644 --- a/library/common/templates/lib/dependencies/_redisInjector.tpl +++ b/library/common/templates/lib/dependencies/_redisInjector.tpl @@ -15,11 +15,15 @@ This template generates a random password and ensures it persists across updates {{- $dbPass = (index $dbprevious.data "redis-password") | b64dec -}} {{- end -}} + {{- $redisUser := .Values.redis.redisUsername -}} + {{- if not $redisUser -}}{{/* If you try to print a nil value it will print as */}} + {{- $redisUser = "" -}} + {{- end -}} {{/* Prepare data */}} {{- $dbHost := printf "%v-%v" .Release.Name "redis" -}} {{- $portHost := printf "%v:6379" $dbHost -}} - {{- $url := printf "redis://%v:%v@%v/%v" .Values.redis.redisUsername $dbPass $portHost $dbIndex -}} - {{- $hostPass := printf "%v:%v@%v" .Values.redis.redisUsername $dbPass $dbHost -}} + {{- $url := printf "redis://%v:%v@%v/%v" $redisUser $dbPass $portHost $dbIndex -}} + {{- $hostPass := printf "%v:%v@%v" $redisUser $dbPass $dbHost -}} {{/* Append some values to redis.creds, so apps using the dep, can use them */}} {{- $_ := set .Values.redis.creds "redisPassword" ($dbPass | quote) -}} diff --git a/library/common/templates/lib/imagePullSecret/_createData.tpl b/library/common/templates/lib/imagePullSecret/_createData.tpl index cf58a891..5ebef018 100644 --- a/library/common/templates/lib/imagePullSecret/_createData.tpl +++ b/library/common/templates/lib/imagePullSecret/_createData.tpl @@ -21,7 +21,8 @@ objectData: "email" (tpl .email $rootCtx) "auth" $auth) -}} {{- end -}} - {{- $_ := set $registrySecret "auths" (dict (tpl $objectData.data.registry $rootCtx) $registry) -}} + {{- $registryKey := tpl $objectData.data.registry $rootCtx -}} + {{- $_ := set $registrySecret "auths" (dict $registryKey $registry) -}} {{/* This should result in something like this: