mirror of
https://github.com/jlengrand/engine.git
synced 2026-03-10 08:11:21 +00:00
23 lines
932 B
YAML
23 lines
932 B
YAML
{{- if and (or (.Files.Glob "files/docker-entrypoint-initdb.d/*.{sh,sql,sql.gz}") .Values.initdbScripts) (not .Values.initdbScriptsConfigMap) }}
|
|
apiVersion: v1
|
|
kind: ConfigMap
|
|
metadata:
|
|
name: {{ template "mysql.master.fullname" . }}-init-scripts
|
|
labels: {{- include "mysql.labels" . | nindent 4 }}
|
|
component: master
|
|
{{- if and (.Files.Glob "files/docker-entrypoint-initdb.d/*.sql.gz") (not .Values.initdbScriptsConfigMap) }}
|
|
binaryData:
|
|
{{- $root := . }}
|
|
{{- range $path, $bytes := .Files.Glob "files/docker-entrypoint-initdb.d/*.sql.gz" }}
|
|
{{ base $path }}: {{ $root.Files.Get $path | b64enc | quote }}
|
|
{{- end }}
|
|
{{- end }}
|
|
data:
|
|
{{- if and (.Files.Glob "files/docker-entrypoint-initdb.d/*.{sh,sql}") (not .Values.initdbScriptsConfigMap) }}
|
|
{{ (.Files.Glob "files/docker-entrypoint-initdb.d/*.{sh,sql}").AsConfig | indent 2 }}
|
|
{{- end }}
|
|
{{- with .Values.initdbScripts }}
|
|
{{ toYaml . | indent 2 }}
|
|
{{- end }}
|
|
{{- end }}
|