File tree 2 files changed +11
-1
lines changed
2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,15 @@ stringData:
59
59
##
60
60
[pools.{{ $pool.name | quote }}.users.{{ $index }}]
61
61
username = {{ $user.username | quote }}
62
+ {{- if $user.password }}
62
63
password = {{ $user.password | quote }}
64
+ {{- else if and $user.passwordSecret.name $user.passwordSecret.key }}
65
+ {{- $secret := (lookup "v1" "Secret" $.Release.Namespace $user.passwordSecret.name) }}
66
+ {{- if $secret }}
67
+ {{- $password := index $secret.data $user.passwordSecret.key | b64dec }}
68
+ password = {{ $password | quote }}
69
+ {{- end }}
70
+ {{- end }}
63
71
pool_size = {{ $user.pool_size }}
64
72
statement_timeout = {{ default 0 $user.statement_timeout }}
65
73
min_pool_size = {{ default 3 $user.min_pool_size }}
Original file line number Diff line number Diff line change @@ -310,7 +310,9 @@ configuration:
310
310
# ## Credentials for users that may connect to this cluster
311
311
# ## @param users [array]
312
312
# ## @param users[0].username Name of the env var (required)
313
- # ## @param users[0].password Value for the env var (required)
313
+ # ## @param users[0].password Value for the env var (required) leave empty to use existing secret see passwordSecret.name and passwordSecret.key
314
+ # ## @param users[0].passwordSecret.name Name of the secret containing the password
315
+ # ## @param users[0].passwordSecret.key Key in the secret containing the password
314
316
# ## @param users[0].pool_size Maximum number of server connections that can be established for this user
315
317
# ## @param users[0].statement_timeout Maximum query duration. Dangerous, but protects against DBs that died in a non-obvious way.
316
318
# users: []
You can’t perform that action at this time.
0 commit comments