blob: 90db4af2681164fa94dfe1df8ad4f72fded09758 [file] [log] [blame]
Giorgi Lekveishvilid1234c12023-06-19 10:37:06 +04001{{/* vim: set filetype=mustache: */}}
2{{/*
3Expand the name of the chart.
4*/}}
5{{- define "cert-manager.name" -}}
6{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
7{{- end -}}
8
9{{/*
10Create a default fully qualified app name.
11We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
12*/}}
13{{- define "cert-manager.fullname" -}}
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 -}}
25
26{{/*
27Create the name of the service account to use
28*/}}
29{{- define "cert-manager.serviceAccountName" -}}
30{{- if .Values.serviceAccount.create -}}
31 {{ default (include "cert-manager.fullname" .) .Values.serviceAccount.name }}
32{{- else -}}
33 {{ default "default" .Values.serviceAccount.name }}
34{{- end -}}
35{{- end -}}
36
37{{/*
38Webhook templates
39*/}}
40
41{{/*
42Expand the name of the chart.
43Manually fix the 'app' and 'name' labels to 'webhook' to maintain
44compatibility with the v0.9 deployment selector.
45*/}}
46{{- define "webhook.name" -}}
47{{- printf "webhook" -}}
48{{- end -}}
49
50{{/*
51Create a default fully qualified app name.
52We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
53If release name contains chart name it will be used as a full name.
54*/}}
55{{- define "webhook.fullname" -}}
56{{- $trimmedName := printf "%s" (include "cert-manager.fullname" .) | trunc 55 | trimSuffix "-" -}}
57{{- printf "%s-webhook" $trimmedName | trunc 63 | trimSuffix "-" -}}
58{{- end -}}
59
60{{- define "webhook.caRef" -}}
61{{- template "cert-manager.namespace" }}/{{ template "webhook.fullname" . }}-ca
62{{- end -}}
63
64{{/*
65Create the name of the service account to use
66*/}}
67{{- define "webhook.serviceAccountName" -}}
68{{- if .Values.webhook.serviceAccount.create -}}
69 {{ default (include "webhook.fullname" .) .Values.webhook.serviceAccount.name }}
70{{- else -}}
71 {{ default "default" .Values.webhook.serviceAccount.name }}
72{{- end -}}
73{{- end -}}
74
75{{/*
76cainjector templates
77*/}}
78
79{{/*
80Expand the name of the chart.
81Manually fix the 'app' and 'name' labels to 'cainjector' to maintain
82compatibility with the v0.9 deployment selector.
83*/}}
84{{- define "cainjector.name" -}}
85{{- printf "cainjector" -}}
86{{- end -}}
87
88{{/*
89Create a default fully qualified app name.
90We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
91If release name contains chart name it will be used as a full name.
92*/}}
93{{- define "cainjector.fullname" -}}
94{{- $trimmedName := printf "%s" (include "cert-manager.fullname" .) | trunc 52 | trimSuffix "-" -}}
95{{- printf "%s-cainjector" $trimmedName | trunc 63 | trimSuffix "-" -}}
96{{- end -}}
97
98{{/*
99Create the name of the service account to use
100*/}}
101{{- define "cainjector.serviceAccountName" -}}
102{{- if .Values.cainjector.serviceAccount.create -}}
103 {{ default (include "cainjector.fullname" .) .Values.cainjector.serviceAccount.name }}
104{{- else -}}
105 {{ default "default" .Values.cainjector.serviceAccount.name }}
106{{- end -}}
107{{- end -}}
108
109{{/*
110startupapicheck templates
111*/}}
112
113{{/*
114Expand the name of the chart.
115Manually fix the 'app' and 'name' labels to 'startupapicheck' to maintain
116compatibility with the v0.9 deployment selector.
117*/}}
118{{- define "startupapicheck.name" -}}
119{{- printf "startupapicheck" -}}
120{{- end -}}
121
122{{/*
123Create a default fully qualified app name.
124We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
125If release name contains chart name it will be used as a full name.
126*/}}
127{{- define "startupapicheck.fullname" -}}
128{{- $trimmedName := printf "%s" (include "cert-manager.fullname" .) | trunc 52 | trimSuffix "-" -}}
129{{- printf "%s-startupapicheck" $trimmedName | trunc 63 | trimSuffix "-" -}}
130{{- end -}}
131
132{{/*
133Create the name of the service account to use
134*/}}
135{{- define "startupapicheck.serviceAccountName" -}}
136{{- if .Values.startupapicheck.serviceAccount.create -}}
137 {{ default (include "startupapicheck.fullname" .) .Values.startupapicheck.serviceAccount.name }}
138{{- else -}}
139 {{ default "default" .Values.startupapicheck.serviceAccount.name }}
140{{- end -}}
141{{- end -}}
142
143{{/*
144Create chart name and version as used by the chart label.
145*/}}
146{{- define "chartName" -}}
147{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
148{{- end -}}
149
150{{/*
151Labels that should be added on each resource
152*/}}
153{{- define "labels" -}}
154app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
155{{- if eq (default "helm" .Values.creator) "helm" }}
156app.kubernetes.io/managed-by: {{ .Release.Service }}
157helm.sh/chart: {{ include "chartName" . }}
158{{- end -}}
159{{- if .Values.global.commonLabels}}
160{{ toYaml .Values.global.commonLabels }}
161{{- end }}
162{{- end -}}
163
164{{/*
165Namespace for all resources to be installed into
166If not defined in values file then the helm release namespace is used
167By default this is not set so the helm release namespace will be used
168
169This gets around an problem within helm discussed here
170https://github.com/helm/helm/issues/5358
171*/}}
172{{- define "cert-manager.namespace" -}}
173 {{ .Values.namespace | default .Release.Namespace }}
174{{- end -}}