Handle the missing part of spec
@@ -112,6 +112,10 @@ func (r *ReconcilePerconaXtraDBCluster) Reconcile(request reconcile.Request) (re
return reconcile.Result{}, err
}
+ if o.Spec.PXC == nil {
+ return reconcile.Result{}, fmt.Errorf("spec.pxc section is not specified. Please check %s cluster settings", o.Name)
+ }
+
defer func() {
uerr := r.updateStatus(o, err)
if uerr != nil {
@@ -170,11 +174,6 @@ func (r *ReconcilePerconaXtraDBCluster) Reconcile(request reconcile.Request) (re
return rr, err
}
- if o.Spec.PXC == nil {
- err = fmt.Errorf("spec.pxc section is not specified. Please check %s cluster settings", o.ClusterName)
- return reconcile.Result{}, err
- }
-
err = r.reconcileUsersSecret(o)
if err != nil {
return reconcile.Result{}, fmt.Errorf("reconcile users secret: %v", err)
