[ROBOT] ADD HTTPS based BULKPM test cases that use helm based components
[testsuite.git] / robot / assets / helm / pm-https-server / templates / _helpers.tpl
1 {{/*
2 Expand the name of the chart.
3 */}}
4 {{- define "pmhttpsserver.name" -}}
5 {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
6 {{- end }}
7
8 {{/*
9 Common namespace
10 */}}
11 {{- define "pmhttpsserver.namespace" -}}
12   {{- default .Release.Namespace .Values.nsPrefix -}}
13 {{- end -}}
14
15 {{/*
16 Create a default fully qualified app name.
17 We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
18 If release name contains chart name it will be used as a full name.
19 */}}
20 {{- define "pmhttpsserver.fullname" -}}
21 {{- if .Values.fullnameOverride }}
22 {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
23 {{- else }}
24 {{- $name := default .Chart.Name .Values.nameOverride }}
25 {{- if contains $name .Release.Name }}
26 {{- .Release.Name | trunc 63 | trimSuffix "-" }}
27 {{- else }}
28 {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
29 {{- end }}
30 {{- end }}
31 {{- end }}
32
33 {{/*
34 Create chart name and version as used by the chart label.
35 */}}
36 {{- define "pmhttpsserver.chart" -}}
37 {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
38 {{- end }}
39
40 {{/*
41 Common labels
42 */}}
43 {{- define "pmhttpsserver.labels" -}}
44 helm.sh/chart: {{ include "pmhttpsserver.chart" . }}
45 {{ include "pmhttpsserver.selectorLabels" . }}
46 {{- if .Chart.AppVersion }}
47 app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
48 {{- end }}
49 app.kubernetes.io/managed-by: {{ .Release.Service }}
50 {{- end }}
51
52 {{/*
53 Selector labels
54 */}}
55 {{- define "pmhttpsserver.selectorLabels" -}}
56 app.kubernetes.io/name: {{ include "pmhttpsserver.name" . }}
57 app.kubernetes.io/instance: {{ .Release.Name }}
58 {{- end }}
59
60 {{/*
61 Create the name of the service account to use
62 */}}
63 {{- define "pmhttpsserver.serviceAccountName" -}}
64 {{- if .Values.serviceAccount.create }}
65 {{- default (include "pmhttpsserver.fullname" .) .Values.serviceAccount.name }}
66 {{- else }}
67 {{- default "default" .Values.serviceAccount.name }}
68 {{- end }}
69 {{- end }}
70
71 {{/*
72 Define dns names in certificate
73 */}}
74 {{- define "pmhttpsserver.dnsNames" -}}
75 {{- range $dnsName := $.Values.certificates.dnsNames }}
76 - {{ $dnsName }}
77 {{- end }}
78 {{- end }}