|  | 
|  | 1 | +{{/* vim: set filetype=mustache: */}} | 
|  | 2 | +{{/* | 
|  | 3 | +Expand the name of the chart. | 
|  | 4 | +*/}} | 
|  | 5 | +{{- define "go-infrabin.name" -}} | 
|  | 6 | +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} | 
|  | 7 | +{{- end }} | 
|  | 8 | + | 
|  | 9 | +{{/* | 
|  | 10 | +Create a default fully qualified app name. | 
|  | 11 | +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | 
|  | 12 | +If release name contains chart name it will be used as a full name. | 
|  | 13 | +*/}} | 
|  | 14 | +{{- define "go-infrabin.fullname" -}} | 
|  | 15 | +{{- if .Values.fullnameOverride }} | 
|  | 16 | +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} | 
|  | 17 | +{{- else }} | 
|  | 18 | +{{- $name := default .Chart.Name .Values.nameOverride }} | 
|  | 19 | +{{- if contains $name .Release.Name }} | 
|  | 20 | +{{- .Release.Name | trunc 63 | trimSuffix "-" }} | 
|  | 21 | +{{- else }} | 
|  | 22 | +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} | 
|  | 23 | +{{- end }} | 
|  | 24 | +{{- end }} | 
|  | 25 | +{{- end }} | 
|  | 26 | + | 
|  | 27 | +{{/* | 
|  | 28 | +Create chart name and version as used by the chart label. | 
|  | 29 | +*/}} | 
|  | 30 | +{{- define "go-infrabin.chart" -}} | 
|  | 31 | +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | 
|  | 32 | +{{- end }} | 
|  | 33 | + | 
|  | 34 | +{{/* | 
|  | 35 | +Common labels | 
|  | 36 | +*/}} | 
|  | 37 | +{{- define "go-infrabin.labels" -}} | 
|  | 38 | +helm.sh/chart: {{ include "go-infrabin.chart" . }} | 
|  | 39 | +{{ include "go-infrabin.selectorLabels" . }} | 
|  | 40 | +{{- if .Chart.AppVersion }} | 
|  | 41 | +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | 
|  | 42 | +{{- end }} | 
|  | 43 | +app.kubernetes.io/managed-by: {{ .Release.Service }} | 
|  | 44 | +{{- end }} | 
|  | 45 | + | 
|  | 46 | +{{/* | 
|  | 47 | +Selector labels | 
|  | 48 | +*/}} | 
|  | 49 | +{{- define "go-infrabin.selectorLabels" -}} | 
|  | 50 | +app.kubernetes.io/name: {{ include "go-infrabin.name" . }} | 
|  | 51 | +app.kubernetes.io/instance: {{ .Release.Name }} | 
|  | 52 | +{{- end }} | 
|  | 53 | + | 
|  | 54 | +{{/* | 
|  | 55 | +Create the name of the service account to use | 
|  | 56 | +*/}} | 
|  | 57 | +{{- define "go-infrabin.serviceAccountName" -}} | 
|  | 58 | +{{- if .Values.serviceAccount.create }} | 
|  | 59 | +{{- default (include "go-infrabin.fullname" .) .Values.serviceAccount.name }} | 
|  | 60 | +{{- else }} | 
|  | 61 | +{{- default "default" .Values.serviceAccount.name }} | 
|  | 62 | +{{- end }} | 
|  | 63 | +{{- end }} | 
0 commit comments