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

{{/* Set it to the same port as "torrent" service/port */}}
{{- $_ := set $.Values.service.torrent.ports.torrentudp "port" .Values.service.torrent.ports.torrent.port -}}

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

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