Shad Ansari | 0a4637a | 2022-05-11 12:20:59 -0700 | [diff] [blame] | 1 | {{/* |
Hyunsun Moon | 97e111d | 2022-05-13 17:56:56 -0700 | [diff] [blame] | 2 | # Copyright 2022-present Open Networking Foundation |
| 3 | |
| 4 | # SPDX-License-Identifier: Apache-2.0 |
Shad Ansari | 0a4637a | 2022-05-11 12:20:59 -0700 | [diff] [blame] | 5 | */}} |
| 6 | |
| 7 | {{/* |
| 8 | Expand 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 | {{/* |
| 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 "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 | {{/* |
| 33 | Create 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 | {{/* |
| 40 | Common labels |
| 41 | */}} |
| 42 | {{- define "person-detection-app.labels" -}} |
| 43 | helm.sh/chart: {{ include "person-detection-app.chart" . }} |
| 44 | {{ include "person-detection-app.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 "person-detection-app.selectorLabels" -}} |
| 55 | app.kubernetes.io/name: {{ include "person-detection-app.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 "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 }} |