Files
charts/bitnami/matomo/templates/_helpers.tpl
Jeremy 4084152a96 [bitnami/matomo] Adding the Matomo Helm Chart (#10652)
* Adding Matomo Chart v0.1.0

Signed-off-by: Jeremy Boyle <jeremy.t.boyle2.mil@swf.army.mil>

* Updating values.yaml, with missing @param values, regenerated README.md

Signed-off-by: Jeremy Boyle <jeremy.t.boyle2.mil@swf.army.mil>

* Updating values.yaml, changed DEBUG = FALSE, regenerated README.md

Signed-off-by: Jeremy Boyle <jeremy.t.boyle2.mil@swf.army.mil>

* Update README.md with readme-generator-for-helm

Signed-off-by: Bitnami Containers <containers@bitnami.com>

* test:  Add VIB testing

Signed-off-by: Javier Salmeron Garcia <jsalmeron@vmware.com>

* fix matomo

Signed-off-by: Javier Salmeron Garcia <jsalmeron@vmware.com>

* test:  Update incorrect url

Signed-off-by: Javier Salmeron Garcia <jsalmeron@vmware.com>

* chore: ⬆️ Update image

Signed-off-by: Javier Salmeron Garcia <jsalmeron@vmware.com>

* Update README.md with readme-generator-for-helm

Signed-off-by: Bitnami Containers <bitnami-bot@vmware.com>

* chore: 🔥 Remove unused variable ingress.hosts and service.httpsport

Signed-off-by: Javier Salmeron Garcia <jsalmeron@vmware.com>

* fix: 🐛 Add reference to missing certificate values

Signed-off-by: Javier Salmeron Garcia <jsalmeron@vmware.com>

* docs: 📝 Fix incorrect placeholder in values documentation

Signed-off-by: Javier Salmeron Garcia <jsalmeron@vmware.com>

* feat:  Adapt ingress to standard and add missing values

Signed-off-by: Javier Salmeron Garcia <jsalmeron@vmware.com>

* Update README.md with readme-generator-for-helm

Signed-off-by: Bitnami Containers <bitnami-bot@vmware.com>

* ci: 👷 Add chart to cd-pipeline

Signed-off-by: Javier Salmeron Garcia <jsalmeron@vmware.com>

* chore: ⬆️ Bump subcharts

Signed-off-by: Javier Salmeron Garcia <jsalmeron@vmware.com>

* test:  Add two extra GOSS tests

Check that the httpd process exists and check the Matomo config contents

Signed-off-by: Javier Salmeron Garcia <jsalmeron@vmware.com>

* test:  Improve cypress tests

- Add documentation on the API
- Check that the user has been created

Signed-off-by: Javier Salmeron Garcia <jsalmeron@vmware.com>

* chore: ⬆️ Bump image tag

Signed-off-by: Javier Salmeron Garcia <jsalmeron@vmware.com>

* Update README.md with readme-generator-for-helm

Signed-off-by: Bitnami Containers <bitnami-bot@vmware.com>

* chore: 🔥 Remove references to service.port

This is a deprecated parameter not used anymore

Signed-off-by: Javier Salmeron Garcia <jsalmeron@vmware.com>

* feat:  Use common.secrets.password.manage for password management

This avoids issues during upgrades

Signed-off-by: Javier Salmeron Garcia <jsalmeron@vmware.com>

* fix: 🐛 Remove erroneous call to coalesce

Signed-off-by: Javier Salmeron Garcia <jsalmeron@vmware.com>

* chore: 🔥 Remove component label

Signed-off-by: Javier Salmeron Garcia <jsalmeron@vmware.com>

* feat:  Add smtpExistingSecret value

Signed-off-by: Javier Salmeron Garcia <jsalmeron@vmware.com>

* fix: 🐛 Use correct PVC values

Signed-off-by: Javier Salmeron Garcia <jsalmeron@vmware.com>

* chore: 🔥 Remove unused reference to sessionAffinity and service.port

Signed-off-by: Javier Salmeron Garcia <jsalmeron@vmware.com>

Co-authored-by: Bitnami Containers <containers@bitnami.com>
Co-authored-by: Javier Salmeron Garcia <jsalmeron@vmware.com>
Co-authored-by: Bitnami Containers <bitnami-bot@vmware.com>
2022-07-07 17:12:39 +02:00

140 lines
3.8 KiB
Smarty

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "matomo.mariadb.fullname" -}}
{{- printf "%s-%s" .Release.Name "mariadb" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Return the proper certificate image name
*/}}
{{- define "certificates.image" -}}
{{- include "common.images.image" ( dict "imageRoot" .Values.certificates.image "global" .Values.global ) -}}
{{- end -}}
{{/*
Return the proper Matomo image name
*/}}
{{- define "matomo.image" -}}
{{- include "common.images.image" (dict "imageRoot" .Values.image "global" .Values.global) -}}
{{- end -}}
{{/*
Return the proper image name (for the metrics image)
*/}}
{{- define "matomo.metrics.image" -}}
{{- include "common.images.image" (dict "imageRoot" .Values.metrics.image "global" .Values.global) -}}
{{- end -}}
{{/*
Return the proper image name (for the init container volume-permissions image)
*/}}
{{- define "matomo.volumePermissions.image" -}}
{{- include "common.images.image" ( dict "imageRoot" .Values.volumePermissions.image "global" .Values.global ) -}}
{{- end -}}
{{/*
Return the proper Docker Image Registry Secret Names
*/}}
{{- define "matomo.imagePullSecrets" -}}
{{- include "common.images.pullSecrets" (dict "images" (list .Values.image .Values.metrics.image .Values.volumePermissions.image .Values.certificates.image) "global" .Values.global) -}}
{{- end -}}
{{/*
Return the proper Storage Class
*/}}
{{- define "matomo.storageClass" -}}
{{- include "common.storage.class" (dict "persistence" .Values.persistence "global" .Values.global) -}}
{{- end -}}
{{/*
Matomo credential secret name
*/}}
{{- define "matomo.secretName" -}}
{{- coalesce .Values.existingSecret (include "common.names.fullname" .) -}}
{{- end -}}
{{/*
Return the SMTP Secret Name
*/}}
{{- define "matomo.smtpSecretName" -}}
{{- if .Values.smtpExistingSecret }}
{{- printf "%s" .Values.smtpExistingSecret -}}
{{- else -}}
{{- printf "%s" (include "common.names.fullname" .) -}}
{{- end -}}
{{- end -}}
{{/*
Return the MariaDB Hostname
*/}}
{{- define "matomo.databaseHost" -}}
{{- if .Values.mariadb.enabled }}
{{- if eq .Values.mariadb.architecture "replication" }}
{{- printf "%s-%s" (include "matomo.mariadb.fullname" .) "primary" | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s" (include "matomo.mariadb.fullname" .) -}}
{{- end -}}
{{- else -}}
{{- printf "%s" .Values.externalDatabase.host -}}
{{- end -}}
{{- end -}}
{{/*
Return the MariaDB Port
*/}}
{{- define "matomo.databasePort" -}}
{{- if .Values.mariadb.enabled }}
{{- printf "3306" -}}
{{- else -}}
{{- printf "%d" (.Values.externalDatabase.port | int ) -}}
{{- end -}}
{{- end -}}
{{/*
Return the MariaDB Database Name
*/}}
{{- define "matomo.databaseName" -}}
{{- if .Values.mariadb.enabled }}
{{- printf "%s" .Values.mariadb.auth.database -}}
{{- else -}}
{{- printf "%s" .Values.externalDatabase.database -}}
{{- end -}}
{{- end -}}
{{/*
Return the MariaDB User
*/}}
{{- define "matomo.databaseUser" -}}
{{- if .Values.mariadb.enabled }}
{{- printf "%s" .Values.mariadb.auth.username -}}
{{- else -}}
{{- printf "%s" .Values.externalDatabase.user -}}
{{- end -}}
{{- end -}}
{{/*
Return the MariaDB Secret Name
*/}}
{{- define "matomo.databaseSecretName" -}}
{{- if .Values.mariadb.enabled }}
{{- printf "%s" (include "matomo.mariadb.fullname" .) -}}
{{- else if .Values.externalDatabase.existingSecret -}}
{{- printf "%s" .Values.externalDatabase.existingSecret -}}
{{- else -}}
{{- printf "%s-%s" (include "common.names.fullname" .) "externaldb" -}}
{{- end -}}
{{- end -}}
{{/*
Return the database password key
*/}}
{{- define "matomo.databasePasswordKey" -}}
{{- if .Values.mariadb.enabled -}}
mariadb-password
{{- else -}}
db-password
{{- end -}}
{{- end -}}