From 7ede16d79eb2caea2b98ab84b9494e8429bfe21f Mon Sep 17 00:00:00 2001 From: Sagar Patil Date: Fri, 10 Apr 2026 11:23:17 +0530 Subject: [PATCH] fix: add hades.read/write.hibernate.cfg.xml configurable from values App expects separate read/write hibernate configs at /etc/onlinesales/db/hadesV2/. Added both files in values-local.yaml with templated DB creds. Changed configmap to use tpl for rendering. Co-Authored-By: Claude Opus 4.6 (1M context) --- hades/templates/configmap.yaml | 5 ++- hades/values-local.yaml | 72 +++++++++++++++++++++++++++++++++- 2 files changed, 73 insertions(+), 4 deletions(-) diff --git a/hades/templates/configmap.yaml b/hades/templates/configmap.yaml index b45e7f6..c64edda 100644 --- a/hades/templates/configmap.yaml +++ b/hades/templates/configmap.yaml @@ -6,8 +6,9 @@ metadata: labels: {{- include "hades.labels" . | nindent 4 }} data: - {{- with .Values.config.files }} - {{- toYaml . | nindent 2 }} + {{- range $filename, $content := .Values.config.files }} + {{ $filename }}: | + {{- tpl $content $ | nindent 4 }} {{- end }} hibernate.cfg.xml: | diff --git a/hades/values-local.yaml b/hades/values-local.yaml index 8463a8d..61df437 100644 --- a/hades/values-local.yaml +++ b/hades/values-local.yaml @@ -115,8 +115,8 @@ config: { test: { logConfig: "/etc/onlinesales/config/hades/log.cfg", - hades_hibernate_config_read: "/etc/onlinesales/config/hades/hibernate.cfg.xml", - hades_hibernate_config_write: "/etc/onlinesales/config/hades/hibernate.cfg.xml", + hades_hibernate_config_read: "/etc/onlinesales/db/hadesV2/hades.read.hibernate.cfg.xml", + hades_hibernate_config_write: "/etc/onlinesales/db/hadesV2/hades.write.hibernate.cfg.xml", rest_accessor_config_file: "/etc/onlinesales/config/hades/restAccessor.cfg", forgot_password_email_config_file: "/etc/onlinesales/config/hades/forgotPasswordEmailSender.cfg", activation_email_config_file: "/etc/onlinesales/config/hades/activationEmailConfigFile.cfg", @@ -293,6 +293,74 @@ config: } } + hades.read.hibernate.cfg.xml: | + + + + + com.mysql.cj.jdbc.Driver + jdbc:mysql://{{ include "hades.databaseHost" . }}:{{ include "hades.databasePort" . }}/{{ include "hades.databaseName" . }}?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true& + {{ include "hades.databaseUsername" . }} + {{ .Values.database.password | default .Values.mysql.mysqlPassword | default "local-mysql-pass" }} + 1 + ai.osmos.dblib.CustomMySQL8DialectUtf8mb4 + thread + org.hibernate.cache.NoCacheProvider + false + false + false + false + 2 + true + true + UTF-8 + 10 + 3600 + 30 + 0 + 10 + 3605 + select 1; + true + + + + hades.write.hibernate.cfg.xml: | + + + + + com.mysql.cj.jdbc.Driver + jdbc:mysql://{{ include "hades.databaseHost" . }}:{{ include "hades.databasePort" . }}/{{ include "hades.databaseName" . }}?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true& + {{ include "hades.databaseUsername" . }} + {{ .Values.database.password | default .Values.mysql.mysqlPassword | default "local-mysql-pass" }} + 1 + ai.osmos.dblib.CustomMySQL8DialectUtf8mb4 + thread + org.hibernate.cache.NoCacheProvider + false + false + false + false + 2 + true + true + UTF-8 + 10 + 3600 + 30 + 0 + 10 + 3605 + select 1; + true + + + # Tomcat writable directories (emptyDir mounts for non-root pods) tomcatWritableDirs: enabled: true