From 84311c7e7c109f76f6462c1591ad057ace68aea9 Mon Sep 17 00:00:00 2001 From: Josef Karasek Date: Mon, 10 Jun 2024 17:24:15 +0200 Subject: [PATCH] fix lint Signed-off-by: Josef Karasek --- controllers/keda/scaledjob_controller.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/controllers/keda/scaledjob_controller.go b/controllers/keda/scaledjob_controller.go index 55b99d0559b..845ba5aca90 100755 --- a/controllers/keda/scaledjob_controller.go +++ b/controllers/keda/scaledjob_controller.go @@ -285,11 +285,9 @@ func (r *ScaledJobReconciler) deletePreviousVersionScaleJobs(ctx context.Context if jobGen, ok := job.Annotations["scaledjob.keda.sh/generation"]; !ok { // delete Jobs that don't have the generation annotation jobIndexes = append(jobIndexes, i) - } else { + } else if jobGen != scaledJobGeneration { // delete Jobs that have a different generation annotation - if jobGen != scaledJobGeneration { - jobIndexes = append(jobIndexes, i) - } + jobIndexes = append(jobIndexes, i) } }