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 }}