Merge "[AAI] Add model-loader tracing config"
[oom.git] / kubernetes / common / mongodb / common / templates / _names.tpl
1 {{/*
2 Copyright VMware, Inc.
3 SPDX-License-Identifier: APACHE-2.0
4 */}}
5
6 {{/* vim: set filetype=mustache: */}}
7 {{/*
8 Expand the name of the chart.
9 */}}
10 {{- define "common.names.name" -}}
11 {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
12 {{- end -}}
13
14 {{/*
15 Create chart name and version as used by the chart label.
16 */}}
17 {{- define "common.names.chart" -}}
18 {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
19 {{- end -}}
20
21 {{/*
22 Create a default fully qualified app name.
23 We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
24 If release name contains chart name it will be used as a full name.
25 */}}
26 {{- define "common.names.fullname" -}}
27 {{- if .Values.fullnameOverride -}}
28 {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
29 {{- else -}}
30 {{- $name := default .Chart.Name .Values.nameOverride -}}
31 {{- if contains $name .Release.Name -}}
32 {{- .Release.Name | trunc 63 | trimSuffix "-" -}}
33 {{- else -}}
34 {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
35 {{- end -}}
36 {{- end -}}
37 {{- end -}}
38
39 {{/*
40 Create a default fully qualified dependency name.
41 We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
42 If release name contains chart name it will be used as a full name.
43 Usage:
44 {{ include "common.names.dependency.fullname" (dict "chartName" "dependency-chart-name" "chartValues" .Values.dependency-chart "context" $) }}
45 */}}
46 {{- define "common.names.dependency.fullname" -}}
47 {{- if .chartValues.fullnameOverride -}}
48 {{- .chartValues.fullnameOverride | trunc 63 | trimSuffix "-" -}}
49 {{- else -}}
50 {{- $name := default .chartName .chartValues.nameOverride -}}
51 {{- if contains $name .context.Release.Name -}}
52 {{- .context.Release.Name | trunc 63 | trimSuffix "-" -}}
53 {{- else -}}
54 {{- printf "%s-%s" .context.Release.Name $name | trunc 63 | trimSuffix "-" -}}
55 {{- end -}}
56 {{- end -}}
57 {{- end -}}
58
59 {{/*
60 Allow the release namespace to be overridden for multi-namespace deployments in combined charts.
61 */}}
62 {{- define "common.names.namespace" -}}
63 {{- default .Release.Namespace .Values.namespaceOverride | trunc 63 | trimSuffix "-" -}}
64 {{- end -}}
65
66 {{/*
67 Create a fully qualified app name adding the installation's namespace.
68 */}}
69 {{- define "common.names.fullname.namespace" -}}
70 {{- printf "%s-%s" (include "common.names.fullname" .) (include "common.names.namespace" .) | trunc 63 | trimSuffix "-" -}}
71 {{- end -}}