Arrobo, Gabriel | 9af7a94 | 2022-09-20 12:48:06 -0700 | [diff] [blame] | 1 | {{- /* |
| 2 | |
| 3 | # Copyright 2022-present Intel Corporation |
| 4 | # |
| 5 | # SPDX-License-Identifier: Apache-2.0 |
| 6 | |
| 7 | */ -}} |
| 8 | |
| 9 | {{/* |
| 10 | Expand the name of the chart. |
| 11 | */}} |
| 12 | {{- define "network-test.name" -}} |
| 13 | {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} |
| 14 | {{- end }} |
| 15 | |
| 16 | {{/* |
| 17 | Create a default fully qualified app name. |
| 18 | We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). |
| 19 | If release name contains chart name it will be used as a full name. |
| 20 | */}} |
| 21 | {{- define "network-test.fullname" -}} |
| 22 | {{- if .Values.fullnameOverride }} |
| 23 | {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} |
| 24 | {{- else }} |
| 25 | {{- $name := default .Chart.Name .Values.nameOverride }} |
| 26 | {{- if contains $name .Release.Name }} |
| 27 | {{- .Release.Name | trunc 63 | trimSuffix "-" }} |
| 28 | {{- else }} |
| 29 | {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} |
| 30 | {{- end }} |
| 31 | {{- end }} |
| 32 | {{- end }} |
| 33 | |
| 34 | {{/* |
| 35 | Create chart name and version as used by the chart label. |
| 36 | */}} |
| 37 | {{- define "network-test.chart" -}} |
| 38 | {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} |
| 39 | {{- end }} |
| 40 | |
| 41 | {{/* |
| 42 | Common labels |
| 43 | */}} |
| 44 | {{- define "network-test.labels" -}} |
| 45 | helm.sh/chart: {{ include "network-test.chart" . }} |
| 46 | {{ include "network-test.selectorLabels" . }} |
| 47 | {{- if .Chart.AppVersion }} |
| 48 | app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} |
| 49 | {{- end }} |
| 50 | app.kubernetes.io/managed-by: {{ .Release.Service }} |
| 51 | {{- end }} |
| 52 | |
| 53 | {{/* |
| 54 | Selector labels |
| 55 | */}} |
| 56 | {{- define "network-test.selectorLabels" -}} |
| 57 | app.kubernetes.io/name: {{ include "network-test.name" . }} |
| 58 | app.kubernetes.io/instance: {{ .Release.Name }} |
| 59 | {{- end }} |