fix: correct scope for capability checks

This commit is contained in:
Jose Diaz-Gonzalez
2025-07-04 02:46:23 -04:00
parent c472c2a3c7
commit f7800adb68
3 changed files with 5 additions and 3 deletions

View File

@@ -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 }}

View File

@@ -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

View File

@@ -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