summaryrefslogtreecommitdiffstats
path: root/deploy/example-webhook/templates/_helpers.tpl
diff options
context:
space:
mode:
authorJames Munnelly <munnerz@users.noreply.github.com>2019-04-14 21:18:24 +0100
committerJames Munnelly <james@munnelly.eu>2019-04-15 15:23:59 +0100
commitafce06a837f4f325af64b38c659c7073613f913f (patch)
tree0a909118d769a6683d8461cc667aa89c5facb93a /deploy/example-webhook/templates/_helpers.tpl
downloadcert-manager-webhook-hostinger-afce06a837f4f325af64b38c659c7073613f913f.tar.gz
cert-manager-webhook-hostinger-afce06a837f4f325af64b38c659c7073613f913f.zip
Initial commit
Diffstat (limited to 'deploy/example-webhook/templates/_helpers.tpl')
-rw-r--r--deploy/example-webhook/templates/_helpers.tpl32
1 files changed, 32 insertions, 0 deletions
diff --git a/deploy/example-webhook/templates/_helpers.tpl b/deploy/example-webhook/templates/_helpers.tpl
new file mode 100644
index 0000000..db3c5cd
--- /dev/null
+++ b/deploy/example-webhook/templates/_helpers.tpl
@@ -0,0 +1,32 @@
+{{/* vim: set filetype=mustache: */}}
+{{/*
+Expand the name of the chart.
+*/}}
+{{- define "example-webhook.name" -}}
+{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
+{{- end -}}
+
+{{/*
+Create a default fully qualified app name.
+We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
+If release name contains chart name it will be used as a full name.
+*/}}
+{{- define "example-webhook.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 "example-webhook.chart" -}}
+{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
+{{- end -}}