{{- if .Values.stackdriver.serviceAccountKey -}}
apiVersion: v1
kind: Secret
metadata:
  name: {{ template "stackdriver-exporter.fullname" . }}
  labels:
    chart: {{ template "stackdriver-exporter.chart" . }}
    app: {{ template "stackdriver-exporter.name" . }}
    release: "{{ .Release.Name }}"
    heritage: "{{ .Release.Service }}"
type: Opaque
data:
  credentials.json: {{ .Values.stackdriver.serviceAccountKey | b64enc | quote }}
{{- end }}
