Files
charts/bitnami/node/templates/_helpers.tpl
Fran Mulero 60d0d9fe3c [bitnami/node] Standarize node (#9783)
* Node standarization

Signed-off-by: Fran Mulero <fmulero@vmware.com>

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

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

* Improve persistence permissions

Signed-off-by: Fran Mulero <fmulero@vmware.com>

* Replace templates, add explanations about diagnosticMode, add quotes

Signed-off-by: Fran Mulero <fmulero@vmware.com>

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

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

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

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

* Change dependencies with mongodb

Signed-off-by: Fran Mulero <fmulero@vmware.com>

* Set current versions supported for mongodb chart

Signed-off-by: Fran Mulero <fmulero@vmware.com>

* Amend chart.lock

Signed-off-by: Fran Mulero <fmulero@vmware.com>

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

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

* Apply suggestions

Signed-off-by: Fran Mulero <fmulero@vmware.com>

* Amend Chart.yaml

Signed-off-by: Fran Mulero <fmulero@vmware.com>

* Apply suggestions

Signed-off-by: Fran Mulero <fmulero@vmware.com>

* [bitnami/node] Update components versions

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

Co-authored-by: Bitnami Containers <containers@bitnami.com>
2022-05-03 15:51:22 +02:00

91 lines
2.9 KiB
Smarty

{{/* vim: set filetype=mustache: */}}
{{/*
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 "node.mongodb.fullname" -}}
{{- printf "%s-%s" .Release.Name "mongodb" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Custom template to get proper service name
*/}}
{{- define "node.secretName" -}}
{{- if .Values.externaldb.secretName }}
{{- printf "%s" .Values.externaldb.secretName }}
{{- else }}
{{- printf "%s-%s" .Release.Name "mongodb-binding" | trunc 63 | trimSuffix "-" -}}
{{- end }}
{{- end -}}
{{/*
Return the proper Node image name
*/}}
{{- define "node.image" -}}
{{- include "common.images.image" (dict "imageRoot" .Values.image "global" .Values.global) -}}
{{- end -}}
{{/*
Return the proper git image name
*/}}
{{- define "git.image" -}}
{{- include "common.images.image" (dict "imageRoot" .Values.git.image "global" .Values.global) -}}
{{- end -}}
{{/*
Return the proper Docker Image Registry Secret Names
*/}}
{{- define "node.imagePullSecrets" -}}
{{- include "common.images.pullSecrets" (dict "images" (list .Values.image .Values.volumePermissions.image .Values.git.image) "global" .Values.global) -}}
{{- end -}}
{{/* Check if there are rolling tags in the images */}}
{{- define "node.checkRollingTags" -}}
{{- include "common.warnings.rollingTag" .Values.image }}
{{- include "common.warnings.rollingTag" .Values.git.image }}
{{- include "common.warnings.rollingTag" .Values.volumePermissions.image }}
{{- end -}}
{{/*
Return the proper image name (for the init container volume-permissions image)
*/}}
{{- define "node.volumePermissions.image" -}}
{{- include "common.images.image" ( dict "imageRoot" .Values.volumePermissions.image "global" .Values.global ) -}}
{{- end -}}
{{/*
Compile all warnings into a single message, and call fail.
*/}}
{{- define "node.validateValues" -}}
{{- $messages := list -}}
{{- $messages := append $messages (include "node.validateValues.database" .) -}}
{{- $messages := without $messages "" -}}
{{- $message := join "\n" $messages -}}
{{- if $message -}}
{{- printf "\nVALUES VALIDATION:\n%s" $message | fail -}}
{{- end -}}
{{- end -}}
{{/* Validate values of Node - Database */}}
{{- define "node.validateValues.database" -}}
{{- if and .Values.mongodb.enabled .Values.externaldb.enabled -}}
node: Database
You can only use one database.
Please choose installing a MongoDB&reg; chart (--set mongodb.enabled=true) or
using an external database (--set externaldb.enabled=true)
{{- end -}}
{{- end -}}
{{/*
Create the name of the service account to use
*/}}
{{- define "node.serviceAccountName" -}}
{{- if .Values.serviceAccount.create -}}
{{ default (include "common.names.fullname" .) .Values.serviceAccount.name }}
{{- else -}}
{{ default "default" .Values.serviceAccount.name }}
{{- end -}}
{{- end -}}