AlexRogalskiy/java-patterns

View on GitHub
charts/templates/init-configmap.yaml

Summary

Maintainability
Test Coverage
{{- if and (or (.Files.Glob "files/docker-entrypoint-initdb.d/*.{sh,sql,sql.gz}") .Values.general.initdbScripts) (not .Values.general.initdbScriptsConfigMap) }}
{{- $fullName := include "backend-java-patterns.fullname" . -}}
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ $fullName }}-init-scripts
  labels:
    {{- include "backend-java-patterns.labels" . | nindent 4 }}
{{- with .Files.Glob "files/docker-entrypoint-initdb.d/*.sql.gz" }}
binaryData:
{{- range $path, $bytes := . }}
  {{ base $path }}: {{ $.Files.Get $path | b64enc | quote }}
{{- end }}
{{- end }}
data:
{{- with .Files.Glob "files/docker-entrypoint-initdb.d/*.{sh,sql}" }}
{{ .AsConfig | indent 2 }}
{{- end }}
{{- with .Values.general.initdbScripts }}
{{ toYaml . | indent 2 }}
{{- end }}
{{- end }}