Update create db user queries

This commit changes the queries to use % instead
of %% in the Host field of CREATE USER and GRANT
ALL statements.

It also uplifts fresh jammy images for mariadb.

Change-Id: I6779f55d962bc9d8efc3b3bfe05b72cbe0b7f863
This commit is contained in:
Sergiy Markin 2025-01-28 16:33:08 +00:00
parent 7c6c32038d
commit 41199aee82
2 changed files with 6 additions and 6 deletions
helm-toolkit/templates/scripts
mariadb

@ -140,10 +140,10 @@ except:
try:
with root_engine.connect() as connection:
connection.execute(
text("CREATE USER IF NOT EXISTS \'{0}\'@\'%%\' IDENTIFIED BY \'{1}\' {2}".format(
text("CREATE USER IF NOT EXISTS \'{0}\'@\'%\' IDENTIFIED BY \'{1}\' {2}".format(
user, password, mysql_x509)))
connection.execute(
text("GRANT ALL ON `{0}`.* TO \'{1}\'@\'%%\'".format(database, user)))
text("GRANT ALL ON `{0}`.* TO \'{1}\'@\'%\'".format(database, user)))
try:
connection.commit()
except AttributeError:

@ -20,16 +20,16 @@ release_group: null
images:
tags:
mariadb: docker.io/openstackhelm/mariadb:latest-ubuntu_focal
mariadb: docker.io/openstackhelm/mariadb:latest-ubuntu_jammy
prometheus_create_mysql_user: docker.io/library/mariadb:10.5.9-focal
prometheus_mysql_exporter: docker.io/prom/mysqld-exporter:v0.12.1
prometheus_mysql_exporter_helm_tests: docker.io/openstackhelm/heat:wallaby-ubuntu_focal
dep_check: quay.io/airshipit/kubernetes-entrypoint:latest-ubuntu_focal
dep_check: quay.io/airshipit/kubernetes-entrypoint:latest-ubuntu_jammy
image_repo_sync: docker.io/library/docker:17.07.0
mariadb_backup: quay.io/airshipit/porthole-mysqlclient-utility:latest-ubuntu_focal
mariadb_backup: quay.io/airshipit/porthole-mysqlclient-utility:latest-ubuntu_jammy
ks_user: docker.io/openstackhelm/heat:wallaby-ubuntu_focal
scripted_test: docker.io/openstackhelm/mariadb:ubuntu_focal-20210415
mariadb_controller: docker.io/openstackhelm/mariadb:latest-ubuntu_focal
mariadb_controller: docker.io/openstackhelm/mariadb:latest-ubuntu_jammy
pull_policy: "IfNotPresent"
local_registry:
active: false