Skip to content

Commit

Permalink
controller: fix operator crashes radondb#464 (radondb#465)
Browse files Browse the repository at this point in the history
  • Loading branch information
acekingke authored Jun 15, 2022
1 parent a58b049 commit 4a1517b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion controllers/mysqlcluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func (r *MysqlClusterReconciler) Reconcile(ctx context.Context, req ctrl.Request
oldInstance := instance.DeepCopy()
defer func() {
// TODO: Remove Status().Patch in mysqlcluster controller.
if !reflect.DeepEqual(oldInstance.Status, instance.Status) {
if instance.ObjectMeta.DeletionTimestamp == nil && !reflect.DeepEqual(oldInstance.Status, instance.Status) {
sErr := r.Status().Patch(ctx, instance.Unwrap(), client.MergeFrom(oldInstance))
if sErr != nil {
log.V(1).Info("failed to update cluster status", "error", sErr)
Expand Down

0 comments on commit 4a1517b

Please sign in to comment.