Skip to content

Commit 0d2a7a9

Browse files
authored
controller: fix operator crashes #464 (#465)
1 parent 2f4dc45 commit 0d2a7a9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

controllers/mysqlcluster_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ func (r *MysqlClusterReconciler) Reconcile(ctx context.Context, req ctrl.Request
9292
oldInstance := instance.DeepCopy()
9393
defer func() {
9494
// TODO: Remove Status().Patch in mysqlcluster controller.
95-
if !reflect.DeepEqual(oldInstance.Status, instance.Status) {
95+
if instance.ObjectMeta.DeletionTimestamp == nil && !reflect.DeepEqual(oldInstance.Status, instance.Status) {
9696
sErr := r.Status().Patch(ctx, instance.Unwrap(), client.MergeFrom(oldInstance))
9797
if sErr != nil {
9898
log.V(1).Info("failed to update cluster status", "error", sErr)

0 commit comments

Comments
 (0)