Amit Wankhede | 3d0bc58 | 2021-10-18 22:28:50 +0530 | [diff] [blame] | 1 | // SPDX-FileCopyrightText: 2021 Open Networking Foundation |
| 2 | // |
| 3 | // SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0 |
| 4 | |
| 5 | {{/* vim: set filetype=mustache: */}} |
| 6 | {{/* |
| 7 | Expand the name of the chart. |
| 8 | */}} |
| 9 | {{- define "plproxy.name" -}} |
| 10 | {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} |
| 11 | {{- end -}} |
| 12 | |
| 13 | {{/* |
| 14 | Create a default fully qualified app name. |
| 15 | We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). |
| 16 | If release name contains chart name it will be used as a full name. |
| 17 | */}} |
| 18 | {{- define "plproxy.fullname" -}} |
| 19 | {{- if contains "config-model-plproxy" .Release.Name -}} |
| 20 | {{- printf "%s-%s" .Release.Name .Chart.AppVersion | trunc 63 | trimSuffix "-" -}} |
| 21 | {{- else -}} |
| 22 | {{- printf "%s-%s-config-model-plproxy" .Release.Name .Chart.AppVersion | trunc 63 | trimSuffix "-" -}} |
| 23 | {{- end -}} |
| 24 | {{- end -}} |
| 25 | |
| 26 | {{/* |
| 27 | Create chart name and version as used by the chart label. |
| 28 | */}} |
| 29 | {{- define "plproxy.chart" -}} |
| 30 | {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} |
| 31 | {{- end -}} |
| 32 | |
| 33 | |
| 34 | {{/* |
| 35 | Common labels |
| 36 | */}} |
| 37 | {{- define "plproxy.labels" -}} |
| 38 | helm.sh/chart: {{ include "plproxy.chart" . }} |
| 39 | {{ include "plproxy.selectorLabels" . }} |
| 40 | {{- if .Chart.AppVersion }} |
| 41 | app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} |
| 42 | {{- end }} |
| 43 | app.kubernetes.io/managed-by: {{ .Release.Service }} |
| 44 | {{- end -}} |
| 45 | |
| 46 | {{/* |
| 47 | Selector labels |
| 48 | */}} |
| 49 | {{- define "plproxy.selectorLabels" -}} |
| 50 | app.kubernetes.io/name: {{ include "plproxy.name" . }} |
| 51 | app.kubernetes.io/instance: {{ .Release.Name }} |
| 52 | {{- end -}} |
| 53 | } |