From f10cfbc528f8d8e54cac0af81acd275372d63a8a Mon Sep 17 00:00:00 2001 From: etamarw Date: Wed, 20 Oct 2021 19:09:14 +0300 Subject: [PATCH] nit: set case before the default Signed-off-by: etamarw --- controllers/keda/scaledjob_controller.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/controllers/keda/scaledjob_controller.go b/controllers/keda/scaledjob_controller.go index 93b3eeb40f4..a63bb9d4773 100644 --- a/controllers/keda/scaledjob_controller.go +++ b/controllers/keda/scaledjob_controller.go @@ -158,6 +158,8 @@ func (r *ScaledJobReconciler) reconcileScaledJob(logger logr.Logger, scaledJob * // Delete Jobs owned by the previous version of the scaledJob based on the rolloutStrategy given for this scaledJob, if any func (r *ScaledJobReconciler) deletePreviousVersionScaleJobs(logger logr.Logger, scaledJob *kedav1alpha1.ScaledJob) (string, error) { switch scaledJob.Spec.RolloutStrategy { + case "gradual": + logger.Info("RolloutStrategy: gradual, Not deleting jobs owned by the previous version of the scaleJob") default: opts := []client.ListOption{ client.InNamespace(scaledJob.GetNamespace()), @@ -180,8 +182,6 @@ func (r *ScaledJobReconciler) deletePreviousVersionScaleJobs(logger logr.Logger, } } return fmt.Sprintf("RolloutStrategy: immediate, deleted jobs owned by the previous version of the scaleJob: %d jobs deleted", len(jobs.Items)), nil - case "gradual": - logger.Info("RolloutStrategy: gradual, Not deleting jobs owned by the previous version of the scaleJob") } return fmt.Sprintf("RolloutStrategy: %s", scaledJob.Spec.RolloutStrategy), nil }