diff --git a/templates/_helpers.tpl b/templates/_helpers.tpl index dfcac3a..6b3eecb 100644 --- a/templates/_helpers.tpl +++ b/templates/_helpers.tpl @@ -70,6 +70,8 @@ {{- define "app.db.database" -}} {{- if .Values.db.database -}} {{- .Values.db.database -}} + {{- else if .Values.global.db.databasePrefix -}} + {{.Values.global.db.databasePrefix}}_{{ include "app.fullname" $ | replace "-" "_" }} {{- else -}} {{ include "app.fullname" $ | replace "-" "_" }} {{- end -}} diff --git a/tests/db-prefix.yaml b/tests/db-prefix.yaml new file mode 100644 index 0000000..d85cfb5 --- /dev/null +++ b/tests/db-prefix.yaml @@ -0,0 +1,6 @@ +name: svc +global: + db: + databasePrefix: customprefix +db: + enabled: true diff --git a/tests/db.yaml b/tests/db.yaml index ab64795..a86a82e 100644 --- a/tests/db.yaml +++ b/tests/db.yaml @@ -1,2 +1,3 @@ +name: svc db: enabled: true diff --git a/values.yaml b/values.yaml index 0551a9c..4fceed0 100644 --- a/values.yaml +++ b/values.yaml @@ -11,6 +11,7 @@ global: db: port: host: + databasePrefix: # node selector for the pods nodeSelector: