|
| 1 | +{{/* |
| 2 | +Expand the name of the PARENT chart. |
| 3 | +*/}} |
| 4 | +{{- define "bitcoincore.name" -}} |
| 5 | +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} |
| 6 | +{{- end }} |
| 7 | + |
| 8 | +{{/* |
| 9 | +Create a default fully qualified PARENT app name. |
| 10 | +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). |
| 11 | +If release name contains chart name it will be used as a full name. |
| 12 | +*/}} |
| 13 | +{{- define "bitcoincore.fullname" -}} |
| 14 | +{{- if .Values.fullnameOverride }} |
| 15 | +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} |
| 16 | +{{- else }} |
| 17 | +{{- printf "%s" .Release.Name | trunc 63 | trimSuffix "-" }} |
| 18 | +{{- end }} |
| 19 | +{{- end }} |
| 20 | + |
| 21 | + |
| 22 | +{{/* |
| 23 | +Expand the name of the chart. |
| 24 | +*/}} |
| 25 | +{{- define "lnd.name" -}} |
| 26 | +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}-ln |
| 27 | +{{- end }} |
| 28 | + |
| 29 | +{{/* |
| 30 | +Create a default fully qualified app name. |
| 31 | +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). |
| 32 | +If release name contains chart name it will be used as a full name. |
| 33 | +*/}} |
| 34 | +{{- define "lnd.fullname" -}} |
| 35 | +{{- if .Values.fullnameOverride }} |
| 36 | +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} |
| 37 | +{{- else }} |
| 38 | +{{- printf "%s" .Release.Name | trunc 63 | trimSuffix "-" }}-ln |
| 39 | +{{- end }} |
| 40 | +{{- end }} |
| 41 | + |
| 42 | +{{/* |
| 43 | +Create chart name and version as used by the chart label. |
| 44 | +*/}} |
| 45 | +{{- define "lnd.chart" -}} |
| 46 | +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} |
| 47 | +{{- end }} |
| 48 | + |
| 49 | +{{/* |
| 50 | +Common labels |
| 51 | +*/}} |
| 52 | +{{- define "lnd.labels" -}} |
| 53 | +helm.sh/chart: {{ include "lnd.chart" . }} |
| 54 | +{{ include "lnd.selectorLabels" . }} |
| 55 | +{{- if .Chart.AppVersion }} |
| 56 | +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} |
| 57 | +{{- end }} |
| 58 | +app.kubernetes.io/managed-by: {{ .Release.Service }} |
| 59 | +{{- end }} |
| 60 | + |
| 61 | +{{/* |
| 62 | +Selector labels |
| 63 | +*/}} |
| 64 | +{{- define "lnd.selectorLabels" -}} |
| 65 | +app.kubernetes.io/name: {{ include "lnd.name" . }} |
| 66 | +app.kubernetes.io/instance: {{ .Release.Name }} |
| 67 | +{{- end }} |
| 68 | + |
| 69 | +{{/* |
| 70 | +Create the name of the service account to use |
| 71 | +*/}} |
| 72 | +{{- define "lnd.serviceAccountName" -}} |
| 73 | +{{- if .Values.serviceAccount.create }} |
| 74 | +{{- default (include "lnd.fullname" .) .Values.serviceAccount.name }} |
| 75 | +{{- else }} |
| 76 | +{{- default "default" .Values.serviceAccount.name }} |
| 77 | +{{- end }} |
| 78 | +{{- end }} |
0 commit comments