Skip to content

Commit 77fda22

Browse files
committed
TransportURL: rely on PatchInstance instead of manual Update
The transporturl controller did a separate client.Update after it initialized it status then continued the normal reconciliation. As it is explicitly updated the status subresource and no finalizer is added this probably works. However to allow easier reasoning about when the instance is updated this patch removes the explicit Update call and instead returns immediately to use the deferred PatchInstance call as the only place that persists the instance.
1 parent 3266115 commit 77fda22

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

controllers/rabbitmq/transporturl_controller.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,8 @@ func (r *TransportURLReconciler) Reconcile(ctx context.Context, req ctrl.Request
150150
instance.Status.ObservedGeneration = instance.Generation
151151

152152
if isNewInstance {
153-
// Register overall status immediately to have an early feedback e.g. in the cli
154-
if err := r.Status().Update(ctx, instance); err != nil {
155-
return ctrl.Result{}, err
156-
}
153+
// Return to register overall status immediately to have an early feedback e.g. in the cli
154+
return ctrl.Result{}, nil
157155
}
158156

159157
return r.reconcileNormal(ctx, instance, helper)

0 commit comments

Comments
 (0)