{{- if or .Values.config .Values.extraConfig }}
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ include "common.names.fullname" . }}
  labels: {{- include "common.labels.standard" . | nindent 4 }}
data:
  {{- if .Values.config }}
  elasticsearch.yml: |-
    {{- toYaml .Values.config | nindent 4 }}
  {{- end }}
  {{- if .Values.extraConfig }}
  my_elasticsearch.yml: |-
    {{- toYaml .Values.extraConfig | nindent 4 }}
  {{- end }}
{{- end }}
