Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b5436dd

Browse filesBrowse files
committed
Allow pulling password from existing secret
1 parent a9f7366 commit b5436dd
Copy full SHA for b5436dd

File tree

Expand file treeCollapse file tree

2 files changed

+11
-1
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+11
-1
lines changed

‎charts/pgcat/templates/secret.yaml

Copy file name to clipboardExpand all lines: charts/pgcat/templates/secret.yaml
+8Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,15 @@ stringData:
5959
##
6060
[pools.{{ $pool.name | quote }}.users.{{ $index }}]
6161
username = {{ $user.username | quote }}
62+
{{- if $user.password }}
6263
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 }}
6371
pool_size = {{ $user.pool_size }}
6472
statement_timeout = {{ default 0 $user.statement_timeout }}
6573
min_pool_size = {{ default 3 $user.min_pool_size }}

‎charts/pgcat/values.yaml

Copy file name to clipboardExpand all lines: charts/pgcat/values.yaml
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,9 @@ configuration:
310310
# ## Credentials for users that may connect to this cluster
311311
# ## @param users [array]
312312
# ## @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
314316
# ## @param users[0].pool_size Maximum number of server connections that can be established for this user
315317
# ## @param users[0].statement_timeout Maximum query duration. Dangerous, but protects against DBs that died in a non-obvious way.
316318
# users: []

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.