Skip to content

Commit

Permalink
Merge pull request #633 from bcgov/fix/helm-chart-helpers
Browse files Browse the repository at this point in the history
[FIX] Helm chart templates not picking up values as expected
  • Loading branch information
i5okie authored Sep 16, 2024
2 parents 5249b32 + 76869d8 commit f1f9cd9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 16 deletions.
1 change: 0 additions & 1 deletion charts/vc-authn-oidc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,6 @@ Note: Secure values of the configuration are passed via equivalent environment v
| ------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------- |
| `acapy.walletStorageCredentials.json` | Raw json with database credentials. Overrides all other values including postgres subchart values. e.g.: '{"account":"postgres","password":"mysecretpassword","admin_account":"postgres","admin_password":"mysecretpassword"}' | `""` |
| `acapy.walletStorageCredentials.account` | Database account name. | `""` |
| `acapy.walletStorageCredentials.password` | Database password. | `""` |
| `acapy.walletStorageCredentials.admin_account` | Database account with CREATEDB role used to create additional databases per wallet. | `postgres` |
| `acapy.walletStorageCredentials.admin_password` | Database password for admin account. | `""` |
| `acapy.walletStorageCredentials.existingSecret` | Name of an existing secret containing 'database-user', 'database-password', 'admin-password' keys. | `""` |
Expand Down
22 changes: 9 additions & 13 deletions charts/vc-authn-oidc/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -337,31 +337,27 @@ Create a default fully qualified app name for the postgres requirement.
Generate acapy wallet storage config
*/}}
{{- define "acapy.walletStorageConfig" -}}
{{- if .Values.acapy.walletStorageConfig -}}
{{- if .Values.acapy.walletStorageConfig.json -}}
{{- .Values.acapy.walletStorageConfig.json -}}
{{- else -}}
'{"url":"{{ .Values.acapy.walletStorageConfig.url }}","max_connections":"{{ .Values.acapy.walletStorageConfig.max_connection | default 10 }}"", "wallet_scheme":"{{ .Values.acapy.walletStorageConfig.wallet_scheme }}"}'
{{- end -}}
{{- .Values.acapy.walletStorageConfig.json -}}
{{- else if .Values.acapy.walletStorageConfig.url -}}
'{"url":"{{ .Values.acapy.walletStorageConfig.url }}","max_connections":"{{ .Values.acapy.walletStorageConfig.max_connection | default 10 }}"", "wallet_scheme":"{{ .Values.acapy.walletStorageConfig.wallet_scheme }}"}'
{{- else if .Values.postgresql.enabled -}}
'{"url":"{{ include "global.postgresql.fullname" . }}:{{ .Values.postgresql.primary.service.ports.postgresql }}","max_connections":"{{ .Values.acapy.walletStorageConfig.max_connections }}", "wallet_scheme":"{{ .Values.acapy.walletStorageConfig.wallet_scheme }}"}'
'{"url":"{{ include "global.postgresql.fullname" . }}:{{ .Values.postgresql.primary.service.ports.postgresql }}","max_connections":"{{ .Values.acapy.walletStorageConfig.max_connections }}", "wallet_scheme":"{{ .Values.acapy.walletStorageConfig.wallet_scheme }}"}'
{{- else -}}
''
''
{{ end }}
{{- end -}}

{{/*
Generate acapy wallet storage credentials
*/}}
{{- define "acapy.walletStorageCredentials" -}}
{{- if .Values.acapy.walletStorageCredentials -}}
{{- if .Values.acapy.walletStorageCredentials.json -}}
{{- .Values.acapy.walletStorageCredentials.json -}}
{{- else -}}
'{"account":"{{ .Values.acapy.walletStorageCredentials.account | default "acapy" }}","password":"{{ .Values.acapy.walletStorageCredentials.password }}", "admin_account":"{{ .Values.acapy.walletStorageCredentials.admin_account }}", "admin_password":"{{ .Values.acapy.walletStorageCredentials.admin_password }}"}'
{{- end -}}
{{- .Values.acapy.walletStorageCredentials.json -}}
{{- else if .Values.postgresql.enabled -}}
'{"account":"{{ .Values.postgresql.auth.username }}","password":"$(POSTGRES_PASSWORD)", "admin_account":"{{ .Values.acapy.walletStorageCredentials.admin_account }}", "admin_password":"$(POSTGRES_POSTGRES_PASSWORD)"}'
'{"account":"{{ .Values.postgresql.auth.username }}","password":"$(POSTGRES_PASSWORD)", "admin_account":"{{ .Values.acapy.walletStorageCredentials.admin_account }}", "admin_password":"$(POSTGRES_POSTGRES_PASSWORD)"}'
{{- else -}}
'{"account":"{{ .Values.acapy.walletStorageCredentials.account | default "acapy" }}","password":"$(POSTGRES_PASSWORD)", "admin_account":"{{ .Values.acapy.walletStorageCredentials.admin_account }}", "admin_password":"$(POSTGRES_POSTGRES_PASSWORD)"}'
{{- end -}}
{{- end -}}

Expand Down
2 changes: 0 additions & 2 deletions charts/vc-authn-oidc/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,6 @@ acapy:
##
## @param acapy.walletStorageCredentials.json Raw json with database credentials. Overrides all other values including postgres subchart values. e.g.: '{"account":"postgres","password":"mysecretpassword","admin_account":"postgres","admin_password":"mysecretpassword"}'
## @param acapy.walletStorageCredentials.account Database account name.
## @param acapy.walletStorageCredentials.password Database password.
## @param acapy.walletStorageCredentials.admin_account Database account with CREATEDB role used to create additional databases per wallet.
## @param acapy.walletStorageCredentials.admin_password Database password for admin account.
## @param acapy.walletStorageCredentials.existingSecret Name of an existing secret containing 'database-user', 'database-password', 'admin-password' keys.
Expand All @@ -362,7 +361,6 @@ acapy:
walletStorageCredentials:
json: ""
account: ""
password: ""
admin_account: postgres
admin_password: ""
existingSecret: ""
Expand Down

0 comments on commit f1f9cd9

Please sign in to comment.