Compare desired replicas to active trial count
This seems to help the sequencing of reconciliations to prevent concurrent attempts at trial creation.
@@ -73,7 +73,7 @@ func (r *ServerReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) {
}
// Create a new trial if necessary
- if exp.Replicas() > 0 {
+ if exp.Replicas() > exp.Status.ActiveTrials {
if result, err := r.nextTrial(ctx, log, exp, trialList); result != nil {
return *result, err
}
