blob: 4385f61a7e57681a2ce802196164735528fbb2fb [file] [log] [blame]
Andy Bavierab75e9e2020-08-06 12:05:30 -07001{{/*
2Copyright 2020-present Open Networking Foundation
3SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
4*/}}
5
6{{/* vim: set filetype=mustache: */}}
7{{/*
8Expand the name of the chart.
9*/}}
10{{- define "grafana-aether.name" -}}
11{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
12{{- end }}
13
14{{/*
15Create a default fully qualified app name.
16We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
17If 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{{/*
33Create 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{{/*
40Common labels
41*/}}
42{{- define "grafana-aether.labels" -}}
43helm.sh/chart: {{ include "grafana-aether.chart" . }}
44{{ include "grafana-aether.selectorLabels" . }}
45{{- if .Chart.AppVersion }}
46app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
47{{- end }}
48app.kubernetes.io/managed-by: {{ .Release.Service }}
49{{- end }}
50
51{{/*
52Selector labels
53*/}}
54{{- define "grafana-aether.selectorLabels" -}}
55app.kubernetes.io/name: {{ include "grafana-aether.name" . }}
56app.kubernetes.io/instance: {{ .Release.Name }}
57{{- end }}
58
59{{/*
60Create 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 }}