32 lines
1.2 KiB
Smarty
32 lines
1.2 KiB
Smarty
{{/* We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). */}}
|
|
|
|
{{- define "common.names.chart" }}
|
|
{{ printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
|
|
{{- end }}
|
|
|
|
{{- define "common.names.name" }}
|
|
{{ default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
|
|
{{- end }}
|
|
|
|
{{- define "common.names.namespace" }}
|
|
{{ default .Release.Namespace .Values.namespaceOverride | trunc 63 | trimSuffix "-" }}
|
|
{{- end }}
|
|
|
|
{{- define "common.names.fullname" }}
|
|
{{- if .Values.fullnameOverride }}
|
|
{{ .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
|
|
{{- else }}
|
|
{{ $name := default .Chart.Name .Values.nameOverride }}
|
|
{{- $releaseName := regexReplaceAll "(-?[^a-z\\d\\-])+-?" (lower .Release.Name) "-" }}
|
|
{{- if contains $name $releaseName }}
|
|
{{ $releaseName | trunc 63 | trimSuffix "-" }}
|
|
{{- else }}
|
|
{{ printf "%s-%s" $releaseName $name | trunc 63 | trimSuffix "-" }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- end }}
|
|
|
|
{{- define "common.names.fullname.namespace" }}
|
|
{{ printf "%s-%s" (include "common.names.fullname" .) (include "common.names.namespace" .) | trunc 63 | trimSuffix "-" }}
|
|
{{- end }}
|