{{- range .Values.configMaps }}
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ .name }}
data:
  {{- range $key, $value := .data }}
  {{- if $value }}
  {{ $key }}: |
    {{- $value | nindent 4 }}
  {{- end }}
  {{- end }}
---
{{- end }}

---

{{- if .Values.starrocksFESpec.entrypoint }}
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ template "starrockscluster.fe.entrypoint.script.configmap.name" .}}
data:
  {{ template "starrockscluster.entrypoint.script.name" .}}: |
    {{- .Values.starrocksFESpec.entrypoint.script | nindent 4 }}
{{- end }}

---

{{- if .Values.starrocksBeSpec.entrypoint }}
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ template "starrockscluster.be.entrypoint.script.configmap.name" .}}
data:
  {{ template "starrockscluster.entrypoint.script.name" .}}: |
    {{- .Values.starrocksBeSpec.entrypoint.script | nindent 4 }}
{{- end }}

---

{{- if .Values.starrocksCnSpec.entrypoint }}
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ template "starrockscluster.cn.entrypoint.script.configmap.name" .}}
data:
  {{ template "starrockscluster.entrypoint.script.name" .}}: |
    {{- .Values.starrocksCnSpec.entrypoint.script | nindent 4 }}
{{- end }}
