{{- if (not .Values.existingCertsSecret) }}
apiVersion: v1
kind: Secret
metadata:
  name: {{ template "mission-control.fullname" . }}-certs
  labels:
    app: {{ template "mission-control.name" . }}
    chart: {{ template "mission-control.chart" . }}
    heritage: {{ .Release.Service }}
    release: {{ .Release.Name }}
type: Opaque
data:
  insight.key: {{ required "A valid .Values.insightKey entry required!" .Values.insightKey | b64enc | quote }}

  insight.crt: {{ required "A valid .Values.insightCrt entry required!" .Values.insightCrt | b64enc | quote }}

  jfmc.crt: {{ required "A valid .Values.jfmcCrt entry required!" .Values.jfmcCrt | b64enc | quote }}

  jfmc-keystore.jks-b64: {{ required "A valid .Values.jfmcKeystore entry required!" .Values.jfmcKeystore | b64enc | quote }}

  jfmc-truststore.jks-b64: {{ required "A valid .Values.jfmcTruststore entry required!" .Values.jfmcTruststore | b64enc | quote }}
{{- end }}