mirror of
https://github.com/dokku/dokku.git
synced 2025-12-29 00:25:08 +01:00
fix: only process web-related templates when there is a web section embedded in the template
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{{- 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 }}
|
||||
|
||||
|
||||
@@ -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)) }}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{{- 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 }}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{{- 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 }}
|
||||
|
||||
|
||||
@@ -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 }}
|
||||
|
||||
{{- $routeToKeda := false }}
|
||||
{{- if and (eq $processName "web") (and $config.autoscaling (and $config.autoscaling.enabled (eq $config.autoscaling.type "keda"))) }}
|
||||
{{- if and $config.autoscaling (and $config.autoscaling.enabled (eq $config.autoscaling.type "keda")) }}
|
||||
{{- if and ($.Capabilities.APIVersions.Has "http.keda.sh/v1alpha1") (and $config.autoscaling.http_trigger (eq $config.autoscaling.http_trigger.type "http")) }}
|
||||
{{- $routeToKeda = true }}
|
||||
{{- end }}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
{{- if .Capabilities.APIVersions.Has "http.keda.sh/v1alpha1" -}}
|
||||
{{- 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 }}
|
||||
|
||||
{{- if and (eq $processName "web") (and $config.autoscaling (and $config.autoscaling.enabled (eq $config.autoscaling.type "keda"))) }}
|
||||
{{- if and $config.autoscaling (and $config.autoscaling.enabled (eq $config.autoscaling.type "keda")) }}
|
||||
{{- if and $config.autoscaling.http_trigger (eq $config.autoscaling.http_trigger.type "http") }}
|
||||
{{- $mappings := dict }}
|
||||
{{- range $pdx, $port_map := $config.web.port_maps }}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
{{- if .Capabilities.APIVersions.Has "http.keda.sh/v1alpha1" -}}
|
||||
{{- 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 }}
|
||||
|
||||
{{- if and (eq $processName "web") (and $config.autoscaling (and $config.autoscaling.enabled (eq $config.autoscaling.type "keda"))) }}
|
||||
{{- if and $config.autoscaling (and $config.autoscaling.enabled (eq $config.autoscaling.type "keda")) }}
|
||||
---
|
||||
kind: Service
|
||||
apiVersion: v1
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{{- if .Capabilities.APIVersions.Has "keda.sh/v1alpha1" -}}
|
||||
{{- 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 }}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{{- 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 }}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user