From 01eb2fea06ecc6b2b972d6178765e01b050b9dd3 Mon Sep 17 00:00:00 2001 From: Vasili Karaev Date: Wed, 2 Jun 2021 11:42:32 +0300 Subject: [PATCH] add doc-origin label --- starters/touchin-docs/templates/_helpers.tpl | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/starters/touchin-docs/templates/_helpers.tpl b/starters/touchin-docs/templates/_helpers.tpl index 6aa440a..1ba1bf4 100644 --- a/starters/touchin-docs/templates/_helpers.tpl +++ b/starters/touchin-docs/templates/_helpers.tpl @@ -36,6 +36,7 @@ Common labels {{- define ".labels" -}} helm.sh/chart: {{ include ".chart" . }} {{ include ".selectorLabels" . }} +{{ include ".touchinLabels" . }} {{- if .Chart.AppVersion }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} @@ -69,3 +70,14 @@ Create the name of the service account to use {{- default "default" .Values.serviceAccount.name }} {{- end }} {{- end }} + +{{/* +Touchin labels +*/}} +{{- define ".touchinLabels" -}} +{{- if .Values.docs.meta.pullRequestNumber }} +touchin.ru/doc-origin: pr:{{ .Values.docs.meta.pullRequestNumber }} +{{- else if .Values.docs.meta.releaseBranch }} +touchin.ru/doc-origin: release:{{ .Values.docs.meta.releaseBranch }} +{{- end }} +{{- end }}