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