puthuparambil.aditya | 7edc795 | 2020-10-01 12:06:33 +0100 | [diff] [blame] | 1 | {{/* vim: set filetype=mustache: */}} |
| 2 | {{/* |
| 3 | Expand the name of the chart. |
| 4 | */}} |
| 5 | {{- define "policy-models-simulator.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 "policy-models-simulator.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 "policy-models-simulator.chart" -}} |
| 31 | {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} |
| 32 | {{- end -}} |
| 33 | |
| 34 | {{/* |
| 35 | Common labels |
| 36 | */}} |
| 37 | {{- define "policy-models-simulator.labels" -}} |
| 38 | app.kubernetes.io/name: {{ include "policy-models-simulator.name" . }} |
| 39 | helm.sh/chart: {{ include "policy-models-simulator.chart" . }} |
| 40 | app.kubernetes.io/instance: {{ .Release.Name }} |
| 41 | {{- if .Chart.AppVersion }} |
| 42 | app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} |
| 43 | {{- end }} |
| 44 | app.kubernetes.io/managed-by: {{ .Release.Service }} |
| 45 | {{- end -}} |
| 46 | |
| 47 | {{/* |
| 48 | Create the name of the service account to use |
| 49 | */}} |
| 50 | {{- define "policy-models-simulator.serviceAccountName" -}} |
| 51 | {{- if .Values.serviceAccount.create -}} |
| 52 | {{ default (include "policy-models-simulator.fullname" .) .Values.serviceAccount.name }} |
| 53 | {{- else -}} |
| 54 | {{ default "default" .Values.serviceAccount.name }} |
| 55 | {{- end -}} |
| 56 | {{- end -}} |