@@ -169,13 +169,6 @@ func (r *GatewayReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ct
169169 }
170170 }
171171
172- if err := r .Provider .Update (ctx , tctx , gateway ); err != nil {
173- acceptStatus = conditionStatus {
174- status : false ,
175- msg : err .Error (),
176- }
177- }
178-
179172 listenerStatuses , err := getListenerStatus (ctx , r .Client , gateway )
180173 if err != nil {
181174 r .Log .Error (err , "failed to get listener status" , "gateway" , req .NamespacedName )
@@ -194,21 +187,26 @@ func (r *GatewayReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ct
194187
195188 r .Updater .Update (status.Update {
196189 NamespacedName : NamespacedName (gateway ),
197- Resource : gateway . DeepCopy () ,
190+ Resource : & gatewayv1. Gateway {} ,
198191 Mutator : status .MutatorFunc (func (obj client.Object ) client.Object {
199192 t , ok := obj .(* gatewayv1.Gateway )
200193 if ! ok {
201194 err := fmt .Errorf ("unsupported object type %T" , obj )
202195 panic (err )
203196 }
204- t .Status = gateway .Status
205- return t
197+ tCopy := t .DeepCopy ()
198+ tCopy .Status = gateway .Status
199+ return tCopy
206200 }),
207201 })
208202
209203 return ctrl.Result {}, nil
210204 }
211205
206+ if err := r .Provider .Update (ctx , tctx , gateway ); err != nil {
207+ return ctrl.Result {}, fmt .Errorf ("failed to update gateway %s: %w" , req .NamespacedName , err )
208+ }
209+
212210 return ctrl.Result {}, nil
213211}
214212
0 commit comments