Skip to content

Commit

Permalink
DBCluster: remove explicit status update
Browse files Browse the repository at this point in the history
To make it easier to reason about when the instance is updated this
patch removes the explicit status update form the input hash generation
code path and let the controller rely on the deferred PatchInstance call
as the only place where the instance is persisted.

The removed code probably didn't cause any trouble as it only updated
the status subresource and all the non status update (the self finalizer)
is guarded with an explicit return from the reconciler. So no non status
update is lost due to this status update. Still this cleanup might help
avoiding future issues.
  • Loading branch information
gibizer committed Apr 25, 2024
1 parent 8367d85 commit 7525e9d
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions controllers/ovndbcluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -823,9 +823,6 @@ func (r *OVNDBClusterReconciler) createHashOfInputHashes(
}
if hashMap, changed := util.SetHash(instance.Status.Hash, common.InputHashName, hash); changed {
instance.Status.Hash = hashMap
if err := r.Client.Status().Update(ctx, instance); err != nil {
return hash, err
}
Log.Info(fmt.Sprintf("Input maps hash %s - %s", common.InputHashName, hash))
}
return hash, nil
Expand Down

0 comments on commit 7525e9d

Please sign in to comment.