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