Skip to content

Commit

Permalink
remove else to make code less indented
Browse files Browse the repository at this point in the history
  • Loading branch information
Mayank Kumar committed Mar 8, 2021
1 parent a91fdfb commit 03aef15
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pkg/controller/cronjob/cronjob_controllerv2.go
Expand Up @@ -225,9 +225,8 @@ func (jm *ControllerV2) resolveControllerRef(namespace string, controllerRef *me

func (jm *ControllerV2) getJobsToBeReconciled(cronJob *batchv1.CronJob) ([]*batchv1.Job, error) {
var jobSelector labels.Selector
if len(cronJob.Spec.JobTemplate.Labels) == 0 {
jobSelector = labels.Everything()
} else {
jobSelector = labels.Everything()
if len(cronJob.Spec.JobTemplate.Labels) != 0 {
jobSelector = labels.Set(cronJob.Spec.JobTemplate.Labels).AsSelector()
}
jobList, err := jm.jobLister.Jobs(cronJob.Namespace).List(jobSelector)
Expand Down

0 comments on commit 03aef15

Please sign in to comment.