---
{{- include "common.values.setup" . }}

{{/* Append the hardcoded settings */}}
{{- define "samba.harcodedValues" -}}
{{- if .Values.configmap.config.enabled }}
{{/* merge Values specific annotations with podAnnotations*/}}
podAnnotations:
  configmap/checksum: "{{ .Values.configmap.config.data | toYaml | sha256sum }}"
{{- end }}

{{- if .Values.configmap.config.enabled }}
{{/* Append the configMap volume to the volumes */}}
persistence:
  config:
    enabled: true
    type: "configMap"
    name: "{{ include "common.names.fullname" . }}-config"
    mountPath: "/data/config.yml"
    subPath: "config.yml"
{{- end }}

service:
  main:
    ports:
      http:
        enabled: false

probes:
  liveness:
    enabled: false
  readiness:
    enabled: false
  startup:
    enabled: false
{{- end -}}
{{- $_ := mergeOverwrite .Values (include "samba.harcodedValues" . | fromYaml) -}}

{{/* Render the templates */}}
{{ include "common.all" . }}
