{{- if eq .Values.dashboard.enabled true }}
apiVersion: v1
kind: ServiceAccount
metadata:
  labels:
    {{- include "tekton-dashboard.labels" . | nindent 4 }}
  name: {{ include "tekton-dashboard.name" . }}
  {{ if and .Values.dashboard.openshift_proxy.enabled (eq .Values.global.platform "openshift")  }}
  annotations:
      serviceaccounts.openshift.io/oauth-redirectreference.primary: '{"kind":"OAuthRedirectReference","apiVersion":"v1","reference":{"kind":"Route","name":"{{ include "tekton-dashboard.name" . }}"}}'
{{ end }}
{{- end }}
