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

{{- include "netbox.secret" . }}

{{- $_ := set .Values.additionalContainers "worker" (include "netbox.worker" . | fromYaml) -}}
{{- $_ := set .Values.additionalContainers "housekeeper" (include "netbox.housekeeper" . | fromYaml) -}}

{{- if .Values.metrics.enabled -}}
{{- $_ := set .Values.podAnnotations "prometheus.io/scrape" "true" -}}
{{- $_ := set .Values.podAnnotations "prometheus.io/path" "/metrics" -}}
{{- $_ := set .Values.podAnnotations "prometheus.io/port" (.Values.service.main.ports.main.targetPort | toString) -}}
{{- end -}}

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