{{- include "ix.v1.common.loader.init" . -}}

{{/* Merge the templates with Values */}}
{{- $_ := mustMergeOverwrite .Values (include "immich.configuration" $ | fromYaml) -}}
{{- $_ := mustMergeOverwrite .Values (include "immich.server.workload" $ | fromYaml) -}}
{{- if .Values.immichConfig.enableML -}}
  {{- $_ := mustMergeOverwrite .Values (include "immich.machinelearning.workload" $ | fromYaml) -}}
{{- end -}}
{{- $_ := mustMergeOverwrite .Values (include "immich.persistence" $ | fromYaml) -}}
{{- $_ := mustMergeOverwrite .Values (include "immich.service" $ | fromYaml) -}}
{{- $_ := mustMergeOverwrite .Values (include "postgres.workload" $ | fromYaml) -}}
{{- $_ := mustMergeOverwrite .Values (include "redis.workload" $ | fromYaml) -}}

{{/* Create the configmap for portal manually*/}}
{{- include "immich.portal" $ -}}

{{- include "ix.v1.common.loader.apply" . -}}
