Andy Bavier | ab75e9e | 2020-08-06 12:05:30 -0700 | [diff] [blame] | 1 | {{/* |
| 2 | Copyright 2020-present Open Networking Foundation |
| 3 | SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0 |
| 4 | */}} |
| 5 | |
| 6 | {{/* vim: set filetype=mustache: */}} |
| 7 | {{/* |
| 8 | Expand the name of the chart. |
| 9 | */}} |
| 10 | {{- define "grafana-aether.name" -}} |
| 11 | {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} |
| 12 | {{- end }} |
| 13 | |
| 14 | {{/* |
| 15 | Create a default fully qualified app name. |
| 16 | We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). |
| 17 | If release name contains chart name it will be used as a full name. |
| 18 | */}} |
| 19 | {{- define "grafana-aether.fullname" -}} |
| 20 | {{- if .Values.fullnameOverride }} |
| 21 | {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} |
| 22 | {{- else }} |
| 23 | {{- $name := default .Chart.Name .Values.nameOverride }} |
| 24 | {{- if contains $name .Release.Name }} |
| 25 | {{- .Release.Name | trunc 63 | trimSuffix "-" }} |
| 26 | {{- else }} |
| 27 | {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} |
| 28 | {{- end }} |
| 29 | {{- end }} |
| 30 | {{- end }} |
| 31 | |
| 32 | {{/* |
| 33 | Create chart name and version as used by the chart label. |
| 34 | */}} |
| 35 | {{- define "grafana-aether.chart" -}} |
| 36 | {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} |
| 37 | {{- end }} |
| 38 | |
| 39 | {{/* |
| 40 | Common labels |
| 41 | */}} |
| 42 | {{- define "grafana-aether.labels" -}} |
| 43 | helm.sh/chart: {{ include "grafana-aether.chart" . }} |
| 44 | {{ include "grafana-aether.selectorLabels" . }} |
| 45 | {{- if .Chart.AppVersion }} |
| 46 | app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} |
| 47 | {{- end }} |
| 48 | app.kubernetes.io/managed-by: {{ .Release.Service }} |
| 49 | {{- end }} |
| 50 | |
| 51 | {{/* |
| 52 | Selector labels |
| 53 | */}} |
| 54 | {{- define "grafana-aether.selectorLabels" -}} |
| 55 | app.kubernetes.io/name: {{ include "grafana-aether.name" . }} |
| 56 | app.kubernetes.io/instance: {{ .Release.Name }} |
| 57 | {{- end }} |
| 58 | |
| 59 | {{/* |
| 60 | Create the name of the service account to use |
| 61 | */}} |
| 62 | {{- define "grafana-aether.serviceAccountName" -}} |
| 63 | {{- if .Values.serviceAccount.create }} |
| 64 | {{- default (include "grafana-aether.fullname" .) .Values.serviceAccount.name }} |
| 65 | {{- else }} |
| 66 | {{- default "default" .Values.serviceAccount.name }} |
| 67 | {{- end }} |
| 68 | {{- end }} |