{{/* vim: set filetype=mustache: */}}
{{- define "srs.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 }}
{{- end }}

{{- define "srs.labels.standard" -}}
cmii.app: video-live-srs
cmii.type: middleware
helm.sh/chart: {{ include "srs.chart" . }}
app.kubernetes.io/managed-by: {{ $.Release.Service }}
{{- if $.Chart.AppVersion }}
app.kubernetes.io/version: {{ $.Chart.AppVersion | quote }}
{{- end }}
{{- end -}}

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

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

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

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

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

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