github.com/1aal/kubeblocks@v0.0.0-20231107070852-e1c03e598921/deploy/apecloud-postgresql/templates/_helpers.tpl (about) 1 {{/* 2 Expand the name of the chart. 3 */}} 4 {{- define "apecloud-postgresql.name" -}} 5 {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} 6 {{- end }} 7 8 {{/* 9 Selector labels 10 */}} 11 {{- define "apecloud-postgresql.selectorLabels" -}} 12 app.kubernetes.io/name: {{ include "apecloud-postgresql.name" . }} 13 app.kubernetes.io/instance: {{ .Release.Name }} 14 {{- end }} 15 16 {{/* 17 Create chart name and version as used by the chart label. 18 */}} 19 {{- define "apecloud-postgresql.chart" -}} 20 {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} 21 {{- end }} 22 23 {{/* 24 Common labels 25 */}} 26 {{- define "apecloud-postgresql.labels" -}} 27 helm.sh/chart: {{ include "apecloud-postgresql.chart" . }} 28 {{ include "apecloud-postgresql.selectorLabels" . }} 29 {{- if .Chart.AppVersion }} 30 app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} 31 {{- end }} 32 app.kubernetes.io/managed-by: {{ .Release.Service }} 33 {{- end }}