From e2d67fff90e7fd26ae3dd29764fdc7bd50ac7e91 Mon Sep 17 00:00:00 2001 From: Titus Vermesan Date: Tue, 8 Oct 2024 09:33:03 +0200 Subject: [PATCH] teplates added --- argocd/apps/wekan/templates/_helpers.tpl | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 argocd/apps/wekan/templates/_helpers.tpl diff --git a/argocd/apps/wekan/templates/_helpers.tpl b/argocd/apps/wekan/templates/_helpers.tpl new file mode 100644 index 0000000..a2d15c5 --- /dev/null +++ b/argocd/apps/wekan/templates/_helpers.tpl @@ -0,0 +1,15 @@ +{{- define "mongodb.url" -}} +{{- if (index .Values "mongodb" "enabled") -}} + {{- $count := (int (index .Values "mongodb" "replicaCount")) -}} + {{- $release := .Release.Name -}} + {{- $mongodbSvcName := include "wekan.mongodb.svcname" . -}} + {{- if gt $count 1 -}} + {{- $replicaSetName := (index .Values "mongodb" "replicaSetName") -}} + mongodb://{{- range $v := until $count }}{{ $release }}-mongodb-{{ $v }}.{{ $mongodbSvcName }}:27017{{ if ne $v (sub $count 1) }},{{- end -}}{{- end -}}/{{ .Values.dbname }}?replicaSet={{ $replicaSetName }} + {{- else -}} + mongodb://{{ $release }}-mongodb-0.{{ $mongodbSvcName }}:27017/{{ .Values.dbname }} + {{- end -}} +{{- else -}} + {{- index .Values "mongodb" "url" -}} +{{- end -}} +{{- end -}}