{{- if not (values .Values.nextcloud.hooks | compact | empty) }}
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ template "nextcloud.fullname" . }}-hooks
  labels:
    {{- include "nextcloud.labels"  ( dict "rootContext" $ ) | nindent 4 }}
data:
  {{- range $hook, $shell := .Values.nextcloud.hooks }}
  {{- if $shell }}
  {{ $hook }}.sh: {{ $shell | quote }}
  {{- end }}
  {{- end }}
{{- end }}
