{{/* vim: set filetype=mustache: */}}
{{/*
Kubernetes standard labels
*/}}
{{- define "srs-cluster.labels.standard" -}}
cmii.app: {{ .Values.srs.name }}
cmii.type: middleware
helm.sh/chart: {{ include "srs-cluster.chart" . }}
app.kubernetes.io/managed-by: {{ $.Release.Service }}
{{- if $.Chart.AppVersion }}
app.kubernetes.io/version: {{ $.Chart.AppVersion | quote }}
{{- end }}
{{- end -}}

{{- define "srs-cluster.labels.origin" -}}
srs-role: origin
{{ include "srs-cluster.labels.standard" . }}
{{- end -}}

{{- define "srs-cluster.labels.edge" -}}
srs-role: edge
{{ include "srs-cluster.labels.standard" . }}
{{- end -}}

{{- define "srs-cluster.labels.nginx" -}}
srs-role: nginx
{{ include "srs-cluster.labels.standard" . }}
{{- end -}}

{{- define "srs-cluster.labels.rtc" -}}
srs-role: rtc
{{ include "srs-cluster.labels.standard" . }}
{{- end -}}

{{/*
Labels to use on deploy.spec.selector.matchLabels and svc.spec.selector
*/}}
{{- define "srs-cluster.matchLabels.origin" -}}
srs-role: origin
{{- end -}}
{{- define "srs-cluster.matchLabels.edge" -}}
srs-role: edge
{{- end -}}
{{- define "srs-cluster.matchLabels.nginx" -}}
srs-role: nginx
{{- end -}}
{{- define "srs-cluster.matchLabels.rtc" -}}
srs-role: rtc
{{- end -}}