github.com/1aal/kubeblocks@v0.0.0-20231107070852-e1c03e598921/deploy/kafka/charts/common/templates/_names.tpl (about) 1 {{/* vim: set filetype=mustache: */}} 2 {{/* 3 Expand the name of the chart. 4 */}} 5 {{- define "common.names.name" -}} 6 {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} 7 {{- end -}} 8 9 {{/* 10 Create chart name and version as used by the chart label. 11 */}} 12 {{- define "common.names.chart" -}} 13 {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | 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 "common.names.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 a default fully qualified dependency name. 36 We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). 37 If release name contains chart name it will be used as a full name. 38 Usage: 39 {{ include "common.names.dependency.fullname" (dict "chartName" "dependency-chart-name" "chartValues" .Values.dependency-chart "context" $) }} 40 */}} 41 {{- define "common.names.dependency.fullname" -}} 42 {{- if .chartValues.fullnameOverride -}} 43 {{- .chartValues.fullnameOverride | trunc 63 | trimSuffix "-" -}} 44 {{- else -}} 45 {{- $name := default .chartName .chartValues.nameOverride -}} 46 {{- if contains $name .context.Release.Name -}} 47 {{- .context.Release.Name | trunc 63 | trimSuffix "-" -}} 48 {{- else -}} 49 {{- printf "%s-%s" .context.Release.Name $name | trunc 63 | trimSuffix "-" -}} 50 {{- end -}} 51 {{- end -}} 52 {{- end -}} 53 54 {{/* 55 Allow the release namespace to be overridden for multi-namespace deployments in combined charts. 56 */}} 57 {{- define "common.names.namespace" -}} 58 {{- if .Values.namespaceOverride -}} 59 {{- .Values.namespaceOverride -}} 60 {{- else -}} 61 {{- .Release.Namespace -}} 62 {{- end -}} 63 {{- end -}} 64 65 {{/* 66 Create a fully qualified app name adding the installation's namespace. 67 */}} 68 {{- define "common.names.fullname.namespace" -}} 69 {{- printf "%s-%s" (include "common.names.fullname" .) (include "common.names.namespace" .) | trunc 63 | trimSuffix "-" -}} 70 {{- end -}}