Scott Baker | c9d3d84 | 2021-09-17 11:32:53 -0700 | [diff] [blame] | 1 | {{/* vim: set filetype=mustache: */}} |
| 2 | {{/* |
| 3 | SPDX-FileCopyrightText: 2020-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 |
Scott Baker | c9d3d84 | 2021-09-17 11:32:53 -0700 | [diff] [blame] | 5 | |
| 6 | Expand the name of the chart. |
| 7 | */}} |
| 8 | {{- define "aether.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.fullname" -}} |
| 18 | {{- if contains "config-model-aether" .Release.Name -}} |
| 19 | {{- printf "%s-%s" .Release.Name .Chart.AppVersion | trunc 63 | trimSuffix "-" -}} |
| 20 | {{- else -}} |
| 21 | {{- printf "%s-%s-config-model-aether" .Release.Name .Chart.AppVersion | trunc 63 | trimSuffix "-" -}} |
| 22 | {{- end -}} |
| 23 | {{- end -}} |
| 24 | |
| 25 | {{/* |
| 26 | Create chart name and version as used by the chart label. |
| 27 | */}} |
| 28 | {{- define "aether.chart" -}} |
| 29 | {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} |
| 30 | {{- end -}} |
| 31 | |
| 32 | |
| 33 | {{/* |
| 34 | Common labels |
| 35 | */}} |
| 36 | {{- define "aether.labels" -}} |
| 37 | helm.sh/chart: {{ include "aether.chart" . }} |
| 38 | {{ include "aether.selectorLabels" . }} |
| 39 | {{- if .Chart.AppVersion }} |
| 40 | app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} |
| 41 | {{- end }} |
| 42 | app.kubernetes.io/managed-by: {{ .Release.Service }} |
| 43 | {{- end -}} |
| 44 | |
| 45 | {{/* |
| 46 | Selector labels |
| 47 | */}} |
| 48 | {{- define "aether.selectorLabels" -}} |
| 49 | app.kubernetes.io/name: {{ include "aether.name" . }} |
| 50 | app.kubernetes.io/instance: {{ .Release.Name }} |
| 51 | {{- end -}} |
| 52 | } |