fix: only process web-related templates when there is a web section embedded in the template

This commit is contained in:
Jose Diaz-Gonzalez committed 2025-07-23 20:16:49 -04:00
1 parent 78bde7f817
commit 68f909b91d
9 files changed
+24 -24

No files matched your search

@@ -1,11 +1,11 @@
{{- range $processName, $config := .Values.processes }}
# Skip cron jobs
{{- if and (hasKey $config "cron") (hasKey $config.cron "id") }}
# Skip processes that don't have a web section
{{- if not (hasKey $config "web") }}
{{- continue }}
{{- end }}
{{- $mappings := dict }}
{{- if eq $processName "web" }}
{{- if hasKey $config "web" }}
{{- range $pdx, $port_map := $config.web.port_maps }}
{{- $mappings := set $mappings $port_map.name "true" }}
{{- end }}
@@ -61,7 +61,7 @@ spec:
{{- range $config.args }}
- {{ . }}
{{- end }}
{{- if eq $processName "web" }}
{{- if hasKey $config "web" }}
env:
- name: PORT
value: "{{ $.Values.global.network.primary_port }}"
@@ -73,7 +73,7 @@ spec:
image: {{ $.Values.global.image.name }}
imagePullPolicy: Always
name: {{ $.Values.global.app_name }}-{{ $processName }}
{{- if eq $processName "web" }}
{{- if hasKey $config "web" }}
ports:
{{- range $pdx, $port_map := $config.web.port_maps }}
{{- if and (eq $port_map.scheme "https") (hasKey $mappings (printf "http-80-%.0f" $port_map.container_port)) }}