Merge pull request #6 from TouchInstinct/feature/doc-origin

add doc-origin label
This commit is contained in:
TonCherAmi 2021-06-02 12:12:39 +03:00 committed by GitHub
commit bcccaaab87
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 0 deletions

View File

@ -36,6 +36,7 @@ Common labels
{{- define "<CHARTNAME>.labels" -}}
helm.sh/chart: {{ include "<CHARTNAME>.chart" . }}
{{ include "<CHARTNAME>.selectorLabels" . }}
{{ include "<CHARTNAME>.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 "<CHARTNAME>.touchinLabels" -}}
{{- if .Values.origin.pullRequestNumber }}
touchin.ru/origin: pr:{{ .Values.origin.pullRequestNumber }}
{{- else if .Values.origin.releaseBranch }}
touchin.ru/origin: release:{{ .Values.origin.releaseBranch }}
{{- end }}
{{- end }}

View File

@ -36,6 +36,7 @@ Common labels
{{- define "<CHARTNAME>.labels" -}}
helm.sh/chart: {{ include "<CHARTNAME>.chart" . }}
{{ include "<CHARTNAME>.selectorLabels" . }}
{{ include "<CHARTNAME>.touchinLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
@ -97,3 +98,14 @@ Get db name
{{- define "<CHARTNAME>.db.name" -}}
{{ .Values.db.name }}{{- if .Values.releaseName}}--{{ .Values.releaseName }}{{- end }}
{{- end }}
{{/*
Touchin labels
*/}}
{{- define "<CHARTNAME>.touchinLabels" -}}
{{- if .Values.origin.pullRequestNumber }}
touchin.ru/origin: pr:{{ .Values.origin.pullRequestNumber }}
{{- else if .Values.origin.releaseBranch }}
touchin.ru/origin: release:{{ .Values.origin.releaseBranch }}
{{- end }}
{{- end }}