fix: do not skip generating certain templates when non-web processes are encountered

This commit is contained in:
Jose Diaz-Gonzalez committed 2025-08-22 01:24:53 -04:00
1 parent 637221f450
commit 390a2254a0
3 files changed
+16 -12

No files matched your search

@@ -1,8 +1,4 @@
{{- range $processName, $config := .Values.processes }} {{- range $processName, $config := .Values.processes }}
{{- if not (hasKey $config "web") }}
# Skip {{ $processName }} as it doesn't have a web section
{{- continue }}
{{- end }}
{{- $mappings := dict }} {{- $mappings := dict }}
{{- if hasKey $config "web" }} {{- if hasKey $config "web" }}
@@ -1,11 +1,7 @@
{{- if .Capabilities.APIVersions.Has "keda.sh/v1alpha1" -}} {{- if .Capabilities.APIVersions.Has "keda.sh/v1alpha1" -}}
{{- range $processName, $config := .Values.processes }} {{- range $processName, $config := .Values.processes }}
{{- if not (hasKey $config "web") }}
# Skip {{ $processName }} as it doesn't have a web section
{{- continue }}
{{- end }}
{{- if and $config.autoscaling (and $config.autoscaling.enabled (eq $config.autoscaling.type "keda")) }} {{- if and (hasKey $config "autoscaling") (and $config.autoscaling.enabled (eq $config.autoscaling.type "keda")) }}
--- ---
apiVersion: keda.sh/v1alpha1 apiVersion: keda.sh/v1alpha1
kind: ScaledObject kind: ScaledObject
+15 -3
View File
@@ -29,6 +29,11 @@ teardown_() {
echo "status: $status" echo "status: $status"
assert_success assert_success
run /bin/bash -c "dokku ps:scale $TEST_APP web=1 worker=2"
echo "output: $output"
echo "status: $status"
assert_success
run deploy_app python dokku@$DOKKU_DOMAIN:$TEST_APP inject_kustomization_yaml run deploy_app python dokku@$DOKKU_DOMAIN:$TEST_APP inject_kustomization_yaml
echo "output: $output" echo "output: $output"
echo "status: $status" echo "status: $status"
@@ -39,6 +44,12 @@ teardown_() {
echo "status: $status" echo "status: $status"
assert_success assert_success
assert_output "3" assert_output "3"
run /bin/bash -c "kubectl get deployment $TEST_APP-worker -o json | jq -r '.spec.replicas'"
echo "output: $output"
echo "status: $status"
assert_success
assert_output "2"
} }
inject_kustomization_yaml() { inject_kustomization_yaml() {
@@ -58,8 +69,9 @@ patches:
path: /spec/replicas path: /spec/replicas
value: 3 value: 3
target: target:
group: apps group: apps
version: v1 version: v1
kind: Deployment kind: Deployment
name: $TEST_APP-worker
EOF EOF
} }