diff --git a/controllers/rpaasinstance_controller.go b/controllers/rpaasinstance_controller.go index ee0eb785a..a5e0b6c91 100644 --- a/controllers/rpaasinstance_controller.go +++ b/controllers/rpaasinstance_controller.go @@ -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 }