{{- if and .Values.ui.enabled .Values.ui.serviceAccount.create }}
apiVersion: v1
kind: ServiceAccount
metadata:
  name: {{ include "model-registry.ui.serviceAccountName" . }}
  {{- if .Values.global.includeNamespace }}
  namespace: {{ include "model-registry.namespace" . }}
  {{- end }}
  labels:
    {{- include "model-registry.ui.labels" . | nindent 4 }}
  {{- with .Values.ui.serviceAccount.annotations }}
  annotations:
    {{- toYaml . | nindent 4 }}
  {{- end }}
{{- if eq .Values.ui.serviceAccount.automountServiceAccountToken true }}
automountServiceAccountToken: {{ .Values.ui.serviceAccount.automountServiceAccountToken }}
{{- end }}
{{- end }}