blob: f7aa1b454e53ef524cd46c6c74e8d6b864c0e4ee [file] [log] [blame]
Shad Ansari0a4637a2022-05-11 12:20:59 -07001{{/*
Hyunsun Moon97e111d2022-05-13 17:56:56 -07002# Copyright 2022-present Open Networking Foundation
3
4# SPDX-License-Identifier: Apache-2.0
Shad Ansari0a4637a2022-05-11 12:20:59 -07005*/}}
6
7{{/*
8Expand the name of the chart.
9*/}}
10{{- define "person-detection-app.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 "person-detection-app.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 "person-detection-app.chart" -}}
36{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
37{{- end }}
38
39{{/*
40Common labels
41*/}}
42{{- define "person-detection-app.labels" -}}
43helm.sh/chart: {{ include "person-detection-app.chart" . }}
44{{ include "person-detection-app.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 "person-detection-app.selectorLabels" -}}
55app.kubernetes.io/name: {{ include "person-detection-app.name" . }}
56app.kubernetes.io/instance: {{ .Release.Name }}
57{{- end }}
58
59{{/*
60Create the name of the service account to use
61*/}}
62{{- define "person-detection-app.serviceAccountName" -}}
63{{- if .Values.serviceAccount.create }}
64{{- default (include "person-detection-app.fullname" .) .Values.serviceAccount.name }}
65{{- else }}
66{{- default "default" .Values.serviceAccount.name }}
67{{- end }}
68{{- end }}