| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- {{/*
- Expand the name of the chart.
- */}}
- {{- define "shop-recycle.name" -}}
- {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
- {{- end }}
- {{/*
- Create a default fully qualified app name.
- */}}
- {{- define "shop-recycle.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.
- */}}
- {{- define "shop-recycle.chart" -}}
- {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
- {{- end }}
- {{/*
- Common labels
- */}}
- {{- define "shop-recycle.labels" -}}
- helm.sh/chart: {{ include "shop-recycle.chart" . }}
- {{ include "shop-recycle.selectorLabels" . }}
- {{- if .Chart.AppVersion }}
- app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
- {{- end }}
- app.kubernetes.io/managed-by: {{ .Release.Service }}
- environment: {{ .Values.environment }}
- {{- end }}
- {{/*
- Selector labels
- */}}
- {{- define "shop-recycle.selectorLabels" -}}
- app.kubernetes.io/name: {{ include "shop-recycle.name" . }}
- app.kubernetes.io/instance: {{ .Release.Name }}
- {{- end }}
- {{/*
- Create the name of the service account to use
- */}}
- {{- define "shop-recycle.serviceAccountName" -}}
- {{- if .Values.rbac.serviceAccountName }}
- {{- .Values.rbac.serviceAccountName }}
- {{- else }}
- {{- include "shop-recycle.fullname" . }}
- {{- end }}
- {{- end }}
- {{/*
- Return image reference
- */}}
- {{- define "shop-recycle.image" -}}
- {{- $registry := .Values.image.registry }}
- {{- $namespace := .Values.image.namespace }}
- {{- $name := .service }}
- {{- $tag := .Values.image.tag | default .Chart.AppVersion }}
- {{- printf "%s/%s/%s:%s" $registry $namespace $name $tag }}
- {{- end }}
- {{/*
- Generate Docker registry config (.dockercfg) for imagePullSecret
- */}}
- {{- define "shop-recycle.registrySecret" -}}
- {{- $username := .Values.global.registry.username }}
- {{- $password := .Values.global.registry.password }}
- {{- $email := .Values.global.registry.email }}
- {{- $registry := .Values.image.registry }}
- {{- $auth := printf "%s:%s" $username $password | b64enc }}
- {{- printf "{%q:{%q:%q,%q:%q,%q:%q,%q:%q}}" $registry "username" $username "password" $password "email" $email "auth" $auth }}
- {{- end }}
|