From 59ce14c2bf847df16858bc09388435a9e5f50bbd Mon Sep 17 00:00:00 2001 From: Zaid Albirawi Date: Wed, 11 Oct 2023 22:12:02 +0200 Subject: [PATCH] Fix extraVolumes and extraVolumeMounts for the tyk-enterprise-portal --- components/tyk-enterprise-portal/templates/_helpers.tpl | 8 ++++++++ .../templates/statefulset-enterprise-portal.yaml | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/components/tyk-enterprise-portal/templates/_helpers.tpl b/components/tyk-enterprise-portal/templates/_helpers.tpl index 965d65a5..73a3e1b8 100644 --- a/components/tyk-enterprise-portal/templates/_helpers.tpl +++ b/components/tyk-enterprise-portal/templates/_helpers.tpl @@ -49,3 +49,11 @@ Selector labels app.kubernetes.io/name: {{ include "tyk-enterprise-portal.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} {{- end }} + +{{- define "tyk-enterprise-portal.tplvalues.render" -}} + {{- if typeIs "string" .value }} + {{- tpl .value .context }} + {{- else }} + {{- tpl (.value | toYaml) .context }} + {{- end }} +{{- end -}} \ No newline at end of file diff --git a/components/tyk-enterprise-portal/templates/statefulset-enterprise-portal.yaml b/components/tyk-enterprise-portal/templates/statefulset-enterprise-portal.yaml index f9f85cfb..8ebb5a35 100644 --- a/components/tyk-enterprise-portal/templates/statefulset-enterprise-portal.yaml +++ b/components/tyk-enterprise-portal/templates/statefulset-enterprise-portal.yaml @@ -209,6 +209,9 @@ spec: mountPath: /opt/portal/db subPath: db {{- end }} + {{- if .Values.extraVolumeMounts }} + {{- include "tyk-enterprise-portal.tplvalues.render" (dict "value" .Values.extraVolumeMounts "context" $) | nindent 10 }} + {{- end }} livenessProbe: httpGet: scheme: "HTTP{{ if .Values.global.tls.enterprisePortal }}S{{ end }}" @@ -234,6 +237,9 @@ spec: persistentVolumeClaim: claimName: {{ .Values.storage.persistence.mountExistingPVC }} {{- end }} + {{- if .Values.extraVolumes }} + {{- include "tyk-enterprise-portal.tplvalues.render" (dict "value" .Values.extraVolumes "context" $) | nindent 6 }} + {{- end }} {{- if .Values.securityContext }} securityContext: