{{- if .Values.dashboards.enabled }}
apiVersion: v1
kind: Secret
metadata:
  name: {{ include "altinity-clickhouse-operator.fullname" . }}-dashboards
  namespace: {{ .Release.Namespace }}
  labels:
    {{- include "altinity-clickhouse-operator.labels" . | nindent 4 }}
{{- if .Values.dashboards.additionalLabels }}
    {{- toYaml .Values.dashboards.additionalLabels | nindent 4 }}
{{- end }}
{{- with .Values.dashboards.annotations }}
  annotations:
    {{- toYaml . | nindent 4 }}
{{- end }}
type: Opaque
data:
{{- range $path, $_ := .Files.Glob "files/*.json" }}
  {{ $path | trimPrefix "files/" }}: {{ $.Files.Get $path | b64enc -}}
{{ end }}
{{- end }}
