diff --git a/templates/_helpers.tpl b/templates/_helpers.tpl index 638b07e12743e8f43e38cb5adbb01ae96e1253e2..84fb76678af2d96a782b583c4ec609d1102d01b3 100644 --- a/templates/_helpers.tpl +++ b/templates/_helpers.tpl @@ -1,9 +1,10 @@ {{/* vim: set filetype=mustache: */}} {{/* Expand the name of the chart. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). */}} {{- define "storageos.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- default "storageos" .Values.nameOverride | trunc 63 | trimSuffix "-" -}} {{- end -}} {{/* @@ -11,9 +12,17 @@ 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 "storageos.fullname" -}} +{{- if .Values.fullnameOverride -}} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} {{- $name := default .Chart.Name .Values.nameOverride -}} +{{- if contains $name .Release.Name -}} +{{- .Release.Name | trunc 63 | trimSuffix "-" -}} +{{- else -}} {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} {{- end -}} +{{- end -}} +{{- end -}} {{/* Create chart name and version as used by the chart label.