{{/* Make sure all variables are set properly */}}
{{- include "tc.v1.common.loader.init" . }}

{{/* Render configmap for vaultwarden */}}
{{- $configmapFile := include "vaultwarden.configmap" . | fromYaml -}}
{{- if $configmapFile -}}
  {{- $_ := set .Values.configmap "vaultwardenconfig" $configmapFile -}}
{{- end -}}

{{/* Render secrets for vaultwarden */}}
{{- $secret := include "vaultwarden.secrets" . | fromYaml -}}
{{- if $secret -}}
  {{- $_ := set .Values.secret "vaultwardensecret" $secret -}}
{{- end -}}

{{/* Render the templates */}}
{{ include "tc.v1.common.loader.apply" . }}
