Sean Condon | 670605a | 2021-12-13 12:58:20 +0000 | [diff] [blame] | 1 | {{/* vim: set filetype=mustache: */}} |
| 2 | {{/* |
| 3 | SPDX-FileCopyrightText: 2021-present Open Networking Foundation <info@opennetworking.org> |
Sean Condon | 160ec1d | 2022-02-08 12:58:25 +0000 | [diff] [blame] | 4 | SPDX-License-Identifier: Apache-2.0 |
Sean Condon | 670605a | 2021-12-13 12:58:20 +0000 | [diff] [blame] | 5 | |
| 6 | Expand the name of the chart. |
| 7 | */}} |
| 8 | {{- define "aether-enterprise-portal.name" -}} |
| 9 | {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} |
| 10 | {{- end -}} |
| 11 | |
| 12 | {{/* |
| 13 | Create a default fully qualified app name. |
| 14 | We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). |
| 15 | If release name contains chart name it will be used as a full name. |
| 16 | */}} |
| 17 | {{- define "aether-enterprise-portal.fullname" -}} |
| 18 | {{- if .Values.fullnameOverride -}} |
| 19 | {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} |
| 20 | {{- else -}} |
| 21 | {{- $name := default .Chart.Name .Values.nameOverride -}} |
| 22 | {{- if contains $name .Release.Name -}} |
| 23 | {{- .Release.Name | trunc 63 | trimSuffix "-" -}} |
| 24 | {{- else -}} |
| 25 | {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} |
| 26 | {{- end -}} |
| 27 | {{- end -}} |
| 28 | {{- end -}} |
| 29 | |
| 30 | {{/* |
| 31 | Create chart name and version as used by the chart label. |
| 32 | */}} |
| 33 | {{- define "aether-enterprise-portal.chart" -}} |
| 34 | {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} |
| 35 | {{- end -}} |
| 36 | |
| 37 | {{/* |
| 38 | Common labels |
| 39 | */}} |
| 40 | {{- define "aether-enterprise-portal.labels" -}} |
| 41 | helm.sh/chart: {{ include "aether-enterprise-portal.chart" . }} |
| 42 | {{ include "aether-enterprise-portal.selectorLabels" . }} |
| 43 | {{- if .Chart.AppVersion }} |
| 44 | app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} |
| 45 | {{- end }} |
| 46 | app.kubernetes.io/managed-by: {{ .Release.Service }} |
| 47 | {{- end -}} |
| 48 | |
| 49 | {{/* |
| 50 | Selector labels |
| 51 | */}} |
| 52 | {{- define "aether-enterprise-portal.selectorLabels" -}} |
| 53 | app.kubernetes.io/name: {{ include "aether-enterprise-portal.name" . }} |
| 54 | app.kubernetes.io/instance: {{ .Release.Name }} |
| 55 | {{- end -}} |
| 56 | |
| 57 | {{/* |
| 58 | Create the name of the service account to use |
| 59 | */}} |
| 60 | {{- define "aether-enterprise-portal.serviceAccountName" -}} |
| 61 | {{- if .Values.serviceAccount.create -}} |
| 62 | {{ default (include "aether-enterprise-portal.fullname" .) .Values.serviceAccount.name }} |
| 63 | {{- else -}} |
| 64 | {{ default "default" .Values.serviceAccount.name }} |
| 65 | {{- end -}} |
| 66 | {{- end -}} |