Skip to content

Commit

Permalink
controller: change merge flavor and plan to proper order
Browse files Browse the repository at this point in the history
  • Loading branch information
morpheu committed Feb 19, 2024
1 parent fe8348d commit 6e3ae69
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions controllers/rpaasinstance_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,18 +81,18 @@ func (r *RpaasInstanceReconciler) Reconcile(ctx context.Context, req ctrl.Reques
return reconcile.Result{}, err
}

if instance.Spec.PlanTemplate != nil {
plan.Spec, err = mergePlans(plan.Spec, *instance.Spec.PlanTemplate)
if err != nil {
return reconcile.Result{}, err
}
}

instanceMergedWithFlavors, err := r.mergeWithFlavors(ctx, instance.DeepCopy())
if err != nil {
return reconcile.Result{}, nil
}

if instanceMergedWithFlavors.Spec.PlanTemplate != nil {
plan.Spec, err = mergePlans(plan.Spec, *instanceMergedWithFlavors.Spec.PlanTemplate)
if err != nil {
return reconcile.Result{}, err
}
}

if err = certificates.ReconcileDynamicCertificates(ctx, r.Client, instance, instanceMergedWithFlavors); err != nil {
return reconcile.Result{}, err
}
Expand Down

0 comments on commit 6e3ae69

Please sign in to comment.