aboutsummaryrefslogtreecommitdiff
path: root/templates/_helpers.tpl
diff options
context:
space:
mode:
Diffstat (limited to 'templates/_helpers.tpl')
-rw-r--r--templates/_helpers.tpl27
1 files changed, 27 insertions, 0 deletions
diff --git a/templates/_helpers.tpl b/templates/_helpers.tpl
index 52158b7..638fade 100644
--- a/templates/_helpers.tpl
+++ b/templates/_helpers.tpl
@@ -14,3 +14,30 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
+
+{{/*
+Create chart name and version as used by the chart label.
+*/}}
+{{- define "invidious.chart" -}}
+{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
+{{- end }}
+
+{{/*
+Common labels
+*/}}
+{{- define "invidious.labels" -}}
+helm.sh/chart: {{ include "invidious.chart" . }}
+{{ include "invidious.selectorLabels" . }}
+{{- if .Chart.AppVersion }}
+app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
+{{- end }}
+app.kubernetes.io/managed-by: {{ .Release.Service }}
+{{- end }}
+
+{{/*
+Selector labels
+*/}}
+{{- define "invidious.selectorLabels" -}}
+app.kubernetes.io/name: {{ include "invidious.name" . }}
+app.kubernetes.io/instance: {{ .Release.Name }}
+{{- end }}