From f7800adb68b101dc5fd92521cd0ef78ce75e0a46 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Fri, 4 Jul 2025 02:46:23 -0400 Subject: [PATCH] fix: correct scope for capability checks --- .../templates/chart/keda-http-scaled-object.yaml | 4 +++- .../templates/chart/keda-interceptor-proxy-service.yaml | 2 +- plugins/scheduler-k3s/templates/chart/keda-scaled-object.yaml | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/plugins/scheduler-k3s/templates/chart/keda-http-scaled-object.yaml b/plugins/scheduler-k3s/templates/chart/keda-http-scaled-object.yaml index e4d4fdd08..be6890a96 100644 --- a/plugins/scheduler-k3s/templates/chart/keda-http-scaled-object.yaml +++ b/plugins/scheduler-k3s/templates/chart/keda-http-scaled-object.yaml @@ -1,3 +1,4 @@ +{{- 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") }} @@ -5,7 +6,7 @@ {{- end }} {{- if and (eq $processName "web") (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")) }} +{{- if and $config.autoscaling.http_trigger (eq $config.autoscaling.http_trigger.type "http") }} {{- $mappings := dict }} {{- range $pdx, $port_map := $config.web.port_maps }} {{- $mappings := set $mappings $port_map.name "true" }} @@ -56,3 +57,4 @@ spec: {{- end }} {{- end }} {{- end }} +{{- end }} diff --git a/plugins/scheduler-k3s/templates/chart/keda-interceptor-proxy-service.yaml b/plugins/scheduler-k3s/templates/chart/keda-interceptor-proxy-service.yaml index ed4575b93..4c259c946 100644 --- a/plugins/scheduler-k3s/templates/chart/keda-interceptor-proxy-service.yaml +++ b/plugins/scheduler-k3s/templates/chart/keda-interceptor-proxy-service.yaml @@ -1,3 +1,4 @@ +{{- 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") }} @@ -5,7 +6,6 @@ {{- end }} {{- if and (eq $processName "web") (and $config.autoscaling (and $config.autoscaling.enabled (eq $config.autoscaling.type "keda"))) }} -{{- if .Capabilities.APIVersions.Has "http.keda.sh/v1alpha1" -}} --- kind: Service apiVersion: v1 diff --git a/plugins/scheduler-k3s/templates/chart/keda-scaled-object.yaml b/plugins/scheduler-k3s/templates/chart/keda-scaled-object.yaml index 9970b1b31..b6633556f 100644 --- a/plugins/scheduler-k3s/templates/chart/keda-scaled-object.yaml +++ b/plugins/scheduler-k3s/templates/chart/keda-scaled-object.yaml @@ -1,3 +1,4 @@ +{{- if .Capabilities.APIVersions.Has "keda.sh/v1alpha1" -}} {{- range $processName, $config := .Values.processes }} # Skip cron jobs {{- if and (hasKey $config "cron") (hasKey $config.cron "id") }} @@ -5,7 +6,6 @@ {{- end }} {{- if and $config.autoscaling (and $config.autoscaling.enabled (eq $config.autoscaling.type "keda")) }} -{{- if .Capabilities.APIVersions.Has "keda.sh/v1alpha1" -}} --- apiVersion: keda.sh/v1alpha1 kind: ScaledObject