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