Skip to content

Commit

Permalink
nit: set case before the default
Browse files Browse the repository at this point in the history
Signed-off-by: etamarw <etamarw@wix.com>
  • Loading branch information
etamarw committed Oct 20, 2021
1 parent cb2d68e commit f10cfbc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions controllers/keda/scaledjob_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
Expand All @@ -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
}
Expand Down

0 comments on commit f10cfbc

Please sign in to comment.