From 434a1119766126214dc212f8c0f6eec84049ad4b Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Fri, 22 Aug 2025 02:29:00 -0400 Subject: [PATCH] fix: skip Deployment and ScaledObject generation for cron tasks --- plugins/scheduler-k3s/templates/chart/deployment.yaml | 4 ++++ plugins/scheduler-k3s/templates/chart/keda-scaled-object.yaml | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/plugins/scheduler-k3s/templates/chart/deployment.yaml b/plugins/scheduler-k3s/templates/chart/deployment.yaml index 0fa6d45b2..30a38ec12 100644 --- a/plugins/scheduler-k3s/templates/chart/deployment.yaml +++ b/plugins/scheduler-k3s/templates/chart/deployment.yaml @@ -1,4 +1,8 @@ {{- range $processName, $config := .Values.processes }} +{{- if hasKey $config "cron" }} +# Skip {{ $processName }} as it is a cron job +{{- continue }} +{{- end }} {{- $mappings := dict }} {{- if hasKey $config "web" }} diff --git a/plugins/scheduler-k3s/templates/chart/keda-scaled-object.yaml b/plugins/scheduler-k3s/templates/chart/keda-scaled-object.yaml index 6487f7c7c..ac0f61f23 100644 --- a/plugins/scheduler-k3s/templates/chart/keda-scaled-object.yaml +++ b/plugins/scheduler-k3s/templates/chart/keda-scaled-object.yaml @@ -1,5 +1,9 @@ {{- if .Capabilities.APIVersions.Has "keda.sh/v1alpha1" -}} {{- range $processName, $config := .Values.processes }} +{{- if hasKey $config "cron" }} +# Skip {{ $processName }} as it is a cron job +{{- continue }} +{{- end }} {{- if and (hasKey $config "autoscaling") (and $config.autoscaling.enabled (eq $config.autoscaling.type "keda")) }} ---