From 4d6a46f69520ffecfdd5ff70c168083ca3173c1d Mon Sep 17 00:00:00 2001 From: Robert Juzak Date: Wed, 15 Nov 2023 13:35:19 +0100 Subject: [PATCH] kimai - mandatory serverVersion parameter to DATABASE_URL --- charts/kimai2/Chart.yaml | 2 +- charts/kimai2/templates/_helpers.tpl | 26 +++++++++++++++++++------- charts/kimai2/values.yaml | 3 +++ 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/charts/kimai2/Chart.yaml b/charts/kimai2/Chart.yaml index 999661c..9231b67 100644 --- a/charts/kimai2/Chart.yaml +++ b/charts/kimai2/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: kimai2 description: A Helm chart for Kubernetes type: application -version: 3.1.4 +version: 3.1.5 appVersion: "apache-2.0.26-prod" dependencies: diff --git a/charts/kimai2/templates/_helpers.tpl b/charts/kimai2/templates/_helpers.tpl index b0164b6..09f3ec7 100644 --- a/charts/kimai2/templates/_helpers.tpl +++ b/charts/kimai2/templates/_helpers.tpl @@ -53,7 +53,7 @@ Return the kimai Secret Name {{- end -}} {{/* -Return the MariaDB Hostname +Return the Database Hostname */}} {{- define "kimai.databaseHost" -}} {{- if .Values.mariadb.enabled }} @@ -66,9 +66,10 @@ Return the MariaDB Hostname {{- printf "%s" .Values.externalDatabase.host -}} {{- end -}} {{- end -}} +{{/* {{/* -Return the MariaDB Port +Return the Database Port */}} {{- define "kimai.databasePort" -}} {{- if .Values.mariadb.enabled }} @@ -79,7 +80,18 @@ Return the MariaDB Port {{- end -}} {{/* -Return the MariaDB Database Name +Return the Database ServerVersion +*/}} +{{- define "kimai.databaseServerVersion" -}} +{{- if .Values.mariadb.enabled }} + {{- printf "%s" (regexReplaceAll "-.*$" .Values.mariadb.image.tag "") -}} +{{- else -}} + {{- printf "%d" (.Values.externalDatabase.port | int ) -}} +{{- end -}} +{{- end -}} + +{{/* +Return the Database Name */}} {{- define "kimai.databaseName" -}} {{- if .Values.mariadb.enabled }} @@ -90,7 +102,7 @@ Return the MariaDB Database Name {{- end -}} {{/* -Return the MariaDB User +Return the Database User */}} {{- define "kimai.databaseUser" -}} {{- if .Values.mariadb.enabled }} @@ -101,7 +113,7 @@ Return the MariaDB User {{- end -}} {{/* -Return the MariaDB Password +Return the Database Password */}} {{- define "kimai.databasePassword" -}} {{- if .Values.mariadb.enabled }} @@ -112,8 +124,8 @@ Return the MariaDB Password {{- end -}} {{/* -Create the database URL. For the time being, this supports only an integrated MySQL +Create the Database URL. For the time being, this supports only an integrated MySQL */}} {{- define "kimai.databaseUrl" -}} -mysql://{{ include "kimai.databaseUser" . }}:{{ include "kimai.databasePassword" . }}@{{ include "kimai.databaseHost" . }}/{{ include "kimai.databaseName" . }} +mysql://{{ include "kimai.databaseUser" . }}:{{ include "kimai.databasePassword" . }}@{{ include "kimai.databaseHost" . }}/{{ include "kimai.databaseName" . }}?charset=utf8&serverVersion={{ include "kimai.databaseServerVersion" . }} {{- end }} diff --git a/charts/kimai2/values.yaml b/charts/kimai2/values.yaml index ab89fa4..f6abf51 100644 --- a/charts/kimai2/values.yaml +++ b/charts/kimai2/values.yaml @@ -873,6 +873,9 @@ externalDatabase: ## @param externalDatabase.port External Database server port ## port: 3306 + ## @param externalDatabase.serverVersion External Database server version + ## + serverVersion: '5.7' ## @param externalDatabase.user External Database username ## user: kimai