diff --git a/contrib/charts/cert-manager/templates/_helpers.tpl b/contrib/charts/cert-manager/templates/_helpers.tpl index 5883b323d..c411d7a5c 100644 --- a/contrib/charts/cert-manager/templates/_helpers.tpl +++ b/contrib/charts/cert-manager/templates/_helpers.tpl @@ -11,9 +11,16 @@ Create a default fully qualified app name. We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). */}} {{- define "cert-manager.fullname" -}} +{{- if .Values.fullnameOverride -}} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} {{- $name := default .Chart.Name .Values.nameOverride -}} -{{- $fullname := printf "%s-%s" $name .Release.Name -}} -{{- default $fullname .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- if contains $name .Release.Name -}} +{{- .Release.Name | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} +{{- end -}} {{- end -}} {{/*