blob: 337004235feb53dff834d6df5ccc5a0799043a1f [file] [log] [blame]
Amit Wankhede3d0bc582021-10-18 22:28:50 +05301// SPDX-FileCopyrightText: 2021 Open Networking Foundation
2//
3// SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
4
5{{/* vim: set filetype=mustache: */}}
6{{/*
7Expand the name of the chart.
8*/}}
9{{- define "plproxy.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 "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{{/*
27Create 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{{/*
35Common labels
36*/}}
37{{- define "plproxy.labels" -}}
38helm.sh/chart: {{ include "plproxy.chart" . }}
39{{ include "plproxy.selectorLabels" . }}
40{{- if .Chart.AppVersion }}
41app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
42{{- end }}
43app.kubernetes.io/managed-by: {{ .Release.Service }}
44{{- end -}}
45
46{{/*
47Selector labels
48*/}}
49{{- define "plproxy.selectorLabels" -}}
50app.kubernetes.io/name: {{ include "plproxy.name" . }}
51app.kubernetes.io/instance: {{ .Release.Name }}
52{{- end -}}
53}