Skip to content

Commit

Permalink
Skip creating trials if add count is zero (#617)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnugeorge authored and k8s-ci-robot committed May 31, 2019
1 parent 1fdca87 commit 7a2ffe1
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions pkg/controller/v1alpha2/experiment/experiment_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,13 +331,15 @@ func (r *ReconcileExperiment) ReconcileTrials(instance *experimentsv1alpha2.Expe
addCount = 0
}

//create "addCount" number of trials
logger.Info("CreateTrials", "addCount", addCount)
if err := r.createTrials(instance, addCount); err != nil {
logger.Error(err, "Create trials error")
return err
//skip if no trials need to be created
if addCount > 0 {
//create "addCount" number of trials
logger.Info("CreateTrials", "addCount", addCount)
if err := r.createTrials(instance, addCount); err != nil {
logger.Error(err, "Create trials error")
return err
}
}

}

return nil
Expand Down

0 comments on commit 7a2ffe1

Please sign in to comment.