{{- define "rtsp.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 }}
{{- end }}

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

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

{{/*
Labels to use on deploy.spec.selector.matchLabels and svc.spec.selector
*/}}
{{- define "rtsp.matchLabels.zlm" -}}
rtsp-role: zlm
{{- end -}}
{{- define "rtsp.matchLabels.op" -}}
rtsp-role: op
{{- end -}}