@@ -46,7 +46,9 @@ Return the Postgres Database hostname
4646Return the Postgres Database Secret Name
4747*/} }
4848{ {- define " backstage.postgresql.databaseSecretName" -} }
49- { {- if .Values.postgresql.auth.existingSecret } }
49+ { {- if ((((.Values).global).postgresql).auth).existingSecret } }
50+ { {- tpl .Values.global.postgresql.auth.existingSecret $ -} }
51+ { {- else if .Values.postgresql.auth.existingSecret } }
5052 { {- tpl .Values.postgresql.auth.existingSecret $ -} }
5153{ {- else -} }
5254 { {- default (include " backstage.postgresql.fullname" .) (tpl .Values.postgresql.auth.existingSecret $) -} }
@@ -57,9 +59,16 @@ Return the Postgres Database Secret Name
5759Return the Postgres databaseSecret key to retrieve credentials for database
5860*/} }
5961{ {- define " backstage.postgresql.databaseSecretKey" -} }
60- { {- if .Values.postgresql.auth.existingSecret -} }
61- { {- .Values.postgresql.auth.secretKeys.userPasswordKey -} }
62+ { {- $defaultDatabaseSecretKey := " password" -} }
63+ { {- if (or ((((.Values).global).postgresql).auth).existingSecret .Values.postgresql.auth.existingSecret) } }
64+ { {- if (((((.Values).global).postgresql).auth).secretKeys).userPasswordKey -} }
65+ { {- .Values.global.postgresql.auth.secretKeys.userPasswordKey -} }
66+ { {- else if ((((.Values).postgresql).auth).secretKeys).userPasswordKey -} }
67+ { {- .Values.postgresql.auth.secretKeys.userPasswordKey -} }
68+ { {- else -} }
69+ { {- print $defaultDatabaseSecretKey -} }
70+ { {- end -} }
6271{ {- else -} }
63- { {- print " password " -} }
72+ { {- print $ defaultDatabaseSecretKey -} }
6473{ {- end -} }
6574{ {- end -} }
0 commit comments