{{- if and .Values.auth.enabled .Values.provider.google.secret }}
apiVersion: v1
kind: Secret
metadata:
  name: {{ template "buzzfeed-sso.fullname" . }}-google
  labels:
    app: {{ template "buzzfeed-sso.name" . }}
    chart: {{ template "buzzfeed-sso.chart" . }}
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
type: Opaque
data:
{{- with .Values.provider.google.secret }}
  google-client-id: {{ .clientId | b64enc }}
  google-client-secret: {{ .clientSecret | b64enc }}
  {{- if .serviceAccount }}
  service-account: {{ .serviceAccount | b64enc }}
  {{- end }}
{{- end }}
{{- end }}
