| Giorgi Lekveishvili | 0ba5e40 | 2024-03-20 15:56:30 +0400 | [diff] [blame] | 1 | {{/* vim: set filetype=mustache: */}} |
| 2 | {{/* |
| 3 | Expand the name of the chart. |
| 4 | */}} |
| 5 | {{- define "pihole.name" -}} |
| 6 | {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} |
| 7 | {{- end -}} |
| 8 | |
| 9 | {{/* |
| 10 | Create a default fully qualified app name. |
| 11 | We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). |
| 12 | If release name contains chart name it will be used as a full name. |
| 13 | */}} |
| 14 | {{- define "pihole.fullname" -}} |
| 15 | {{- if .Values.fullnameOverride -}} |
| 16 | {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} |
| 17 | {{- else -}} |
| 18 | {{- $name := default .Chart.Name .Values.nameOverride -}} |
| 19 | {{- if contains $name .Release.Name -}} |
| 20 | {{- .Release.Name | trunc 63 | trimSuffix "-" -}} |
| 21 | {{- else -}} |
| 22 | {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} |
| 23 | {{- end -}} |
| 24 | {{- end -}} |
| 25 | {{- end -}} |
| 26 | |
| 27 | {{/* |
| 28 | Create chart name and version as used by the chart label. |
| 29 | */}} |
| 30 | {{- define "pihole.chart" -}} |
| 31 | {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} |
| 32 | {{- end -}} |
| 33 | |
| 34 | {{/* |
| 35 | Default password secret name. |
| 36 | */}} |
| 37 | {{- define "pihole.password-secret" -}} |
| 38 | {{- printf "%s-%s" (include "pihole.fullname" .) "password" | replace "+" "_" | trunc 63 | trimSuffix "-" -}} |
| 39 | {{- end -}} |