Tadas Sutkaitis | 8d03724 | 2024-02-08 02:48:21 +0200 | [diff] [blame] | 1 | {{/* vim: set filetype=mustache: */}} |
| 2 | {{/* |
| 3 | Expand the name of the chart. |
| 4 | */}} |
| 5 | {{- define "godaddy-webhook.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 "godaddy-webhook.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 "godaddy-webhook.chart" -}} |
| 31 | {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} |
| 32 | {{- end -}} |
| 33 | |
| 34 | {{/* |
| 35 | Common labels |
| 36 | */}} |
| 37 | {{- define "godaddy-webhook.labels" -}} |
| 38 | app.kubernetes.io/name: {{ include "godaddy-webhook.name" . }} |
| 39 | helm.sh/chart: {{ include "godaddy-webhook.chart" . }} |
| 40 | app.kubernetes.io/instance: {{ .Release.Name }} |
| 41 | {{- if .Chart.AppVersion }} |
| 42 | app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} |
| 43 | {{- end }} |
| 44 | app.kubernetes.io/managed-by: {{ .Release.Service }} |
| 45 | {{- end -}} |
| 46 | |
| 47 | {{/* |
| 48 | PKI |
| 49 | */}} |
| 50 | {{- define "godaddy-webhook.selfSignedIssuer" -}} |
| 51 | {{ printf "%s-selfsign" (include "godaddy-webhook.fullname" .) }} |
| 52 | {{- end -}} |
| 53 | |
| 54 | {{- define "godaddy-webhook.rootCAIssuer" -}} |
| 55 | {{ printf "%s-ca" (include "godaddy-webhook.fullname" .) }} |
| 56 | {{- end -}} |
| 57 | |
| 58 | {{- define "godaddy-webhook.rootCACertificate" -}} |
| 59 | {{ printf "%s-ca" (include "godaddy-webhook.fullname" .) }} |
| 60 | {{- end -}} |
| 61 | |
| 62 | {{- define "godaddy-webhook.servingCertificate" -}} |
| 63 | {{ printf "%s-webhook-tls" (include "godaddy-webhook.fullname" .) }} |
| 64 | {{- end -}} |