Skip to content

Commit ae0f184

Browse files
committed
Allow disabling db connection string injection
When using database secrets or connection details managed by the mariadb-operator for example, the automatic injection of the database.connection into the service .conf file is detrimental. This allows users to disable that magic by explicitly setting the connection to the value of 'null' and leaving the replacement behavior in place for other cases. The existing charts used 'null' in some cases but its a cleaner case to handle 'null' for this so switch them to defaulting to the empty string. Add values_overrides/<chart>/mariadb-operator.yaml for all 26 charts showing how to opt out of chart-managed database connection strings when using mariadb-operator. Each override sets the relevant connection key(s) to null and disables the db-init, and db secret manifests that are no longer needed when the operator manages the database lifecycle. To opt out of chart-managed connection strings (e.g. when using mariadb-operator to supply them via a mounted configuration snippet), set the relevant key to null in a values override: conf: keystone: database: connection: null # mariadb-operator provides [database] Other keys in the database section (max_retries, etc.) are unaffected and continue to be rendered normally. Assisted-by: Claude Sonnet 4.6 <claude-sonnet-4-6@anthropic.com> Change-Id: I7385dfb67f3d8899a8c3d1479b06f2ae21bc5791 Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
1 parent 51e7247 commit ae0f184

78 files changed

Lines changed: 2512 additions & 37 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

aodh/templates/configmap-etc.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ limitations under the License.
5757
{{- $_ := set .Values.conf.aodh.keystone_authtoken "memcache_secret_key" ( default ( randAlphaNum 64 ) .Values.endpoints.oslo_cache.auth.memcache_secret_key ) -}}
5858
{{- end -}}
5959

60-
{{- if empty .Values.conf.aodh.database.connection -}}
60+
{{- if and (not (kindIs "invalid" .Values.conf.aodh.database.connection)) (empty .Values.conf.aodh.database.connection) -}}
6161
{{- $_ := tuple "oslo_db" "internal" "aodh" "mysql" . | include "helm-toolkit.endpoints.authenticated_endpoint_uri_lookup" | set .Values.conf.aodh.database "connection" -}}
6262
{{- end -}}
6363

aodh/values.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,11 @@ conf:
474474
database:
475475
alarm_history_time_to_live: 86400
476476
max_retries: -1
477+
# -- Database connection URI. When empty the URI is auto-generated
478+
## from endpoints.oslo_db. Set to null to disable auto-generation,
479+
## e.g. when using an operator such as mariadb-operator that supplies
480+
## the connection string via a mounted configuration snippet.
481+
connection: ""
477482
keystone_authtoken:
478483
auth_version: v3
479484
auth_type: password

barbican/templates/configmap-etc.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ limitations under the License.
4949
{{- $_ := set .Values.conf.barbican.keystone_authtoken "memcache_secret_key" ( default ( randAlphaNum 64 ) .Values.endpoints.oslo_cache.auth.memcache_secret_key ) -}}
5050
{{- end -}}
5151

52-
{{- if empty .Values.conf.barbican.database.connection -}}
52+
{{- if and (not (kindIs "invalid" .Values.conf.barbican.database.connection)) (empty .Values.conf.barbican.database.connection) -}}
5353
{{- $connection := tuple "oslo_db" "internal" "barbican" "mysql" . | include "helm-toolkit.endpoints.authenticated_endpoint_uri_lookup" -}}
5454
{{- if .Values.manifests.certificates -}}
5555
{{- $_ := (printf "%s?charset=utf8&ssl_ca=/etc/mysql/certs/ca.crt&ssl_key=/etc/mysql/certs/tls.key&ssl_cert=/etc/mysql/certs/tls.crt&ssl_verify_cert" $connection ) | set .Values.conf.barbican.database "connection" -}}

barbican/values.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,11 @@ conf:
409409
service_type: key-manager
410410
database:
411411
max_retries: -1
412+
# -- Database connection URI. When empty the URI is auto-generated
413+
## from endpoints.oslo_db. Set to null to disable auto-generation,
414+
## e.g. when using an operator such as mariadb-operator that supplies
415+
## the connection string via a mounted configuration snippet.
416+
connection: ""
412417
barbican_api:
413418
# NOTE(portdirect): the bind port should not be defined, and is manipulated
414419
# via the endpoints section.

blazar/templates/configmap-etc.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ limitations under the License.
3636
{{- $_ := set .Values.conf.blazar.keystone_authtoken "memcache_secret_key" ( default ( randAlphaNum 64 ) .Values.endpoints.oslo_cache.auth.memcache_secret_key ) -}}
3737
{{- end -}}
3838

39-
{{- if empty .Values.conf.blazar.database.connection -}}
39+
{{- if and (not (kindIs "invalid" .Values.conf.blazar.database.connection)) (empty .Values.conf.blazar.database.connection) -}}
4040
{{- $_ := tuple "oslo_db" "internal" "blazar" "mysql" . | include "helm-toolkit.endpoints.authenticated_endpoint_uri_lookup"| set .Values.conf.blazar.database "connection" -}}
4141
{{- end -}}
4242
{{- if empty .Values.conf.blazar.DEFAULT.transport_url -}}

blazar/values.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -612,6 +612,11 @@ conf:
612612
os_admin_project_domain_name:
613613
database:
614614
max_retries: -1
615+
# -- Database connection URI. When empty the URI is auto-generated
616+
## from endpoints.oslo_db. Set to null to disable auto-generation,
617+
## e.g. when using an operator such as mariadb-operator that supplies
618+
## the connection string via a mounted configuration snippet.
619+
connection: ""
615620
keystone_authtoken:
616621
service_token_roles: service
617622
service_token_roles_required: true

cinder/templates/configmap-etc.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ limitations under the License.
3434
{{- $_ := tuple "identity" "internal" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup"| set $envAll.Values.conf.cinder.nova "auth_url" -}}
3535
{{- end }}
3636

37-
{{- if empty .Values.conf.cinder.database.connection -}}
37+
{{- if and (not (kindIs "invalid" .Values.conf.cinder.database.connection)) (empty .Values.conf.cinder.database.connection) -}}
3838
{{- $connection := tuple "oslo_db" "internal" "cinder" "mysql" . | include "helm-toolkit.endpoints.authenticated_endpoint_uri_lookup" -}}
3939
{{- if .Values.manifests.certificates -}}
4040
{{- $_ := (printf "%s?charset=utf8&ssl_ca=/etc/mysql/certs/ca.crt&ssl_key=/etc/mysql/certs/tls.key&ssl_cert=/etc/mysql/certs/tls.crt&ssl_verify_cert" $connection ) | set .Values.conf.cinder.database "connection" -}}

cinder/values.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -862,6 +862,11 @@ conf:
862862
internal_user_name: internal_cinder
863863
database:
864864
max_retries: -1
865+
# -- Database connection URI. When empty the URI is auto-generated
866+
## from endpoints.oslo_db. Set to null to disable auto-generation,
867+
## e.g. when using an operator such as mariadb-operator that supplies
868+
## the connection string via a mounted configuration snippet.
869+
connection: ""
865870
keystone_authtoken:
866871
service_token_roles: service
867872
service_token_roles_required: true

cloudkitty/templates/configmap-etc.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ limitations under the License.
3232
{{- $_ := set .Values.conf.cloudkitty.keystone_authtoken "memcache_secret_key" ( default ( randAlphaNum 64 ) .Values.endpoints.oslo_cache.auth.memcache_secret_key ) -}}
3333
{{- end -}}
3434

35-
{{- if empty .Values.conf.cloudkitty.database.connection -}}
35+
{{- if and (not (kindIs "invalid" .Values.conf.cloudkitty.database.connection)) (empty .Values.conf.cloudkitty.database.connection) -}}
3636
{{- $connection := tuple "oslo_db" "internal" "cloudkitty" "mysql" . | include "helm-toolkit.endpoints.authenticated_endpoint_uri_lookup" -}}
3737
{{- if .Values.manifests.certificates -}}
3838
{{- $_ := (printf "%s?charset=utf8&ssl_ca=/etc/mysql/certs/ca.crt&ssl_key=/etc/mysql/certs/tls.key&ssl_cert=/etc/mysql/certs/tls.crt&ssl_verify_cert" $connection ) | set .Values.conf.cloudkitty.database "connection" -}}

cloudkitty/values.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -578,6 +578,11 @@ conf:
578578
service_type: rating
579579
database:
580580
max_retries: -1
581+
# -- Database connection URI. When empty the URI is auto-generated
582+
## from endpoints.oslo_db. Set to null to disable auto-generation,
583+
## e.g. when using an operator such as mariadb-operator that supplies
584+
## the connection string via a mounted configuration snippet.
585+
connection: ""
581586
oslo_concurrency:
582587
lock_path: /var/lock
583588
collect:

0 commit comments

Comments
 (0)