Skip to content

Commit 59c524c

Browse files
authored
Reconcile status only on a non-nil CR. (#696)
1 parent 3eee82e commit 59c524c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pkg/controller/ps/status.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ import (
2929
)
3030

3131
func (r *PerconaServerMySQLReconciler) reconcileCRStatus(ctx context.Context, cr *apiv1alpha1.PerconaServerMySQL, reconcileErr error) error {
32+
if cr == nil || cr.ObjectMeta.DeletionTimestamp != nil {
33+
return nil
34+
}
35+
3236
clusterCondition := metav1.Condition{
3337
Status: metav1.ConditionTrue,
3438
Type: apiv1alpha1.StateInitializing.String(),
@@ -56,10 +60,6 @@ func (r *PerconaServerMySQLReconciler) reconcileCRStatus(ctx context.Context, cr
5660

5761
log := logf.FromContext(ctx).WithName("reconcileCRStatus")
5862

59-
if cr == nil || cr.ObjectMeta.DeletionTimestamp != nil {
60-
return nil
61-
}
62-
6363
mysqlStatus, err := r.appStatus(ctx, cr, mysql.Name(cr), cr.MySQLSpec().Size, mysql.MatchLabels(cr), cr.Status.MySQL.Version)
6464
if err != nil {
6565
return errors.Wrap(err, "get MySQL status")

0 commit comments

Comments
 (0)