blob: c9a0eb6733015a573fdbfa144b0996dce2f550ac [file] [log] [blame]
Mohammed Naser4569e9b2024-07-19 01:08:18 -04001{{/*
2Expand the name of the chart.
3*/}}
4{{- define "goldpinger.name" -}}
5{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
6{{- end }}
7
8{{/*
9Create a default fully qualified app name.
10We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
11If release name contains chart name it will be used as a full name.
12*/}}
13{{- define "goldpinger.fullname" -}}
14{{- if .Values.fullnameOverride }}
15{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
16{{- else }}
17{{- $name := default .Chart.Name .Values.nameOverride }}
18{{- if contains $name .Release.Name }}
19{{- .Release.Name | trunc 63 | trimSuffix "-" }}
20{{- else }}
21{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
22{{- end }}
23{{- end }}
24{{- end }}
25
26{{/*
27Create chart name and version as used by the chart label.
28*/}}
29{{- define "goldpinger.chart" -}}
30{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
31{{- end }}
32
33{{/*
34Common labels
35*/}}
36{{- define "goldpinger.labels" -}}
37helm.sh/chart: {{ include "goldpinger.chart" . }}
38{{ include "goldpinger.selectorLabels" . }}
39{{- if .Chart.AppVersion }}
40app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
41{{- end }}
42app.kubernetes.io/managed-by: {{ .Release.Service }}
43{{- end }}
44
45{{/*
46Selector labels
47*/}}
48{{- define "goldpinger.selectorLabels" -}}
49app.kubernetes.io/name: {{ include "goldpinger.name" . }}
50app.kubernetes.io/instance: {{ .Release.Name }}
51{{- end }}
52
53{{/*
54Create the name of the service account to use
55*/}}
56{{- define "goldpinger.serviceAccountName" -}}
57{{- if .Values.serviceAccount.create }}
58{{- default (include "goldpinger.fullname" .) .Values.serviceAccount.name }}
59{{- else }}
60{{- default "default" .Values.serviceAccount.name }}
61{{- end }}
62{{- end }}