From ffb6b84b3cff443b5c3e2f0257c09b4f39617bfd Mon Sep 17 00:00:00 2001 From: Sagar Patil Date: Tue, 28 Apr 2026 14:09:06 +0530 Subject: [PATCH 1/2] fix: revert database.username to hades_user (Backstage overrides this value) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The values.yaml database.username has no effect when Backstage deploys with mysql.enabled=false — Backstage passes the username from the UI. The shared MySQL init SQL needs to create hades_user separately. Co-Authored-By: Claude Opus 4.6 (1M context) --- hades/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hades/values.yaml b/hades/values.yaml index bef2c30..138bdc3 100644 --- a/hades/values.yaml +++ b/hades/values.yaml @@ -123,7 +123,7 @@ database: host: "" # Will be set to mysql.fullname if mysql.enabled=true port: "3306" name: "hades_db" - username: "mysql_user" + username: "hades_user" password: "" # Leave empty to auto-generate # For external database, set mysql.enabled=false and configure above values -- 2.47.2 From 7a9c1db489a604bc09fd83a4d73a670e2c99a508 Mon Sep 17 00:00:00 2001 From: Sagar Patil Date: Tue, 28 Apr 2026 14:17:52 +0530 Subject: [PATCH 2/2] fix: use configurable root credentials for dbinit job via values.yaml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit dbInit.mysqlUser and dbInit.mysqlPasswordKey are now configurable in values.yaml. Defaults to root/mysql-root-password since SQL migrations need SUPER privilege for triggers with DEFINER=root@%. App (hades-service) still connects as hades_user — only the migration job uses root. Co-Authored-By: Claude Opus 4.6 (1M context) --- hades/templates/job-dbinit.yaml | 4 ++-- hades/values.yaml | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/hades/templates/job-dbinit.yaml b/hades/templates/job-dbinit.yaml index 0c8f584..4d4ad5d 100644 --- a/hades/templates/job-dbinit.yaml +++ b/hades/templates/job-dbinit.yaml @@ -50,12 +50,12 @@ spec: - name: MYSQL_DATABASE value: {{ include "hades.databaseName" . | quote }} - name: MYSQL_USER - value: {{ include "hades.databaseUsername" . | quote }} + value: {{ .Values.dbInit.mysqlUser | default "root" | quote }} - name: MYSQL_PWD valueFrom: secretKeyRef: name: {{ include "hades.databaseSecretName" . }} - key: mysql-password + key: {{ .Values.dbInit.mysqlPasswordKey | default "mysql-root-password" }} command: - /bin/bash - -c diff --git a/hades/values.yaml b/hades/values.yaml index 138bdc3..74a03d8 100644 --- a/hades/values.yaml +++ b/hades/values.yaml @@ -166,6 +166,8 @@ mysql: # Automatically runs all SQL migration files from sql/ directory in alphabetical order dbInit: enabled: true + mysqlUser: "root" + mysqlPasswordKey: "mysql-root-password" # ConfigMap for application configuration files config: -- 2.47.2