{{- if not .Values.datadog.apiKeyExistingSecret }}

apiVersion: v1
kind: Secret
metadata:
  name: {{ template "datadog.fullname" . }}
  labels:
    app: "{{ template "datadog.fullname" . }}"
    chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
    release: {{ .Release.Name | quote }}
    heritage: {{ .Release.Service | quote }}
type: Opaque
data:
  api-key: {{ default "MISSING" .Values.datadog.apiKey | b64enc | quote }}

{{- end }}
