Skip to content

Commit

Permalink
[utils] Resolve secrets in proxysql.cfg
Browse files Browse the repository at this point in the history
Since we're going to use secret references instead of actual values, we
need to rewrite them with our `resolve_secret` helper to resolve them.
  • Loading branch information
joker-at-work committed Apr 12, 2024
1 parent cd47a8c commit 95433b3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions openstack/utils/templates/snippets/_proxysql.cfg.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ mysql_variables =
{{- end }}
{{- end }}
monitor_enabled = true
monitor_username = "{{ .global.Values.mariadb.users.proxysql_monitor.name | required ".global.Values.mariadb.users.proxysql_monitor.name is required!" }}"
monitor_password = "{{ .global.Values.mariadb.users.proxysql_monitor.password | required ".global.Values.mariadb.users.proxysql_monitor.password is required!" }}"
monitor_username = "{{ include "resolve_secret" .global.Values.mariadb.users.proxysql_monitor.name | required ".global.Values.mariadb.users.proxysql_monitor.name is required!" }}"
monitor_password = "{{ include "resolve_secret" .global.Values.mariadb.users.proxysql_monitor.password | required ".global.Values.mariadb.users.proxysql_monitor.password is required!" }}"
{{- end }}
connect_retries_on_failure = {{ default 1000 .global.Values.proxysql.connect_retries_on_failure }}
connect_retries_delay = {{ default 100 .global.Values.proxysql.connect_retries_delay }} {{- /* The default is 1ms, and that means we will run through the retries on failure in no time */}}
Expand All @@ -57,8 +57,8 @@ mysql_users =
{{- range $userKey, $user := $db.users }}
{{- if ne $userKey "proxysql_monitor" }}
{
username = "{{ $user.name | required (print "user name needs to be set for " $dbKey " and user " $userKey) }}"
password = "{{ $user.password | required "password needs to be set for all extra dbs" }}"
username = "{{ include "resolve_secret" $user.name | required (print "user name needs to be set for " $dbKey " and user " $userKey) }}"
password = "{{ include "resolve_secret" $user.password | required "password needs to be set for all extra dbs" }}"
default_hostgroup = {{ $index }}
},
{{- end }}
Expand Down

0 comments on commit 95433b3

Please sign in to comment.