Skip to content

Commit

Permalink
Update controllers/lmes/lmevaljob_controller.go
Browse files Browse the repository at this point in the history
Co-authored-by: Yihong Wang <[email protected]>
Signed-off-by: ted chang <[email protected]>
  • Loading branch information
tedhtchang and yhwang committed Oct 17, 2024
1 parent 6ea5144 commit 3b943ad
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions controllers/lmes/lmevaljob_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,6 @@ func (r *LMEvalJobReconciler) SetupWithManager(mgr ctrl.Manager) error {

return err
}
var err error
if err := constructOptionsFromConfigMap(&log, &cm); err != nil {
return err
}
Expand Down Expand Up @@ -727,7 +726,7 @@ func mergeMapWithFilters(dest, src map[string]string, prefixFilters []string, lo
}
}

func generateArgs(options *serviceOptions, job *lmesv1alpha1.LMEvalJob, log logr.Logger) []string {
func generateArgs(svcOpts *serviceOptions, job *lmesv1alpha1.LMEvalJob, log logr.Logger) []string {
if job == nil {
return nil
}
Expand Down Expand Up @@ -761,13 +760,13 @@ func generateArgs(options *serviceOptions, job *lmesv1alpha1.LMEvalJob, log logr
cmds = append(cmds, "--log_samples")
}
// --batch_size
var batchSize = options.DefaultBatchSize
var batchSize = svcOpts.DefaultBatchSize
if job.Spec.BatchSize != nil && *job.Spec.BatchSize > 0 {
batchSize = *job.Spec.BatchSize
}
// This could be done in the webhook if it's enabled.
if batchSize > options.MaxBatchSize {
batchSize = options.MaxBatchSize
if batchSize > svcOpts.MaxBatchSize {
batchSize = svcOpts.MaxBatchSize
log.Info("batchSize is greater than max-batch-size of the controller's configuration, use the max-batch-size instead")
}
cmds = append(cmds, "--batch_size", fmt.Sprintf("%d", batchSize))
Expand Down

0 comments on commit 3b943ad

Please sign in to comment.