@@ -215,63 +215,72 @@ func (r *gatewayAPIReconciler) Reconcile(ctx context.Context, _ reconcile.Reques
215
215
string (gwapiv1 .GatewayClassReasonInvalidParameters ),
216
216
msg )
217
217
r .resources .GatewayClassStatuses .Store (utils .NamespacedName (gc ), & gc .Status )
218
- return reconcile. Result {}, nil
218
+ continue
219
219
}
220
220
}
221
221
222
222
// Add all Gateways, their associated Routes, and referenced resources to the resourceTree
223
223
if err = r .processGateways (ctx , managedGC , resourceMappings , gwcResource ); err != nil {
224
- return reconcile.Result {}, err
224
+ r .log .Error (err , fmt .Sprintf ("failed processGateways for gatewayClass %s, skipping it" , managedGC .Name ))
225
+ continue
225
226
}
226
227
227
228
if r .eppCRDExists {
228
229
// Add all EnvoyPatchPolicies to the resourceTree
229
230
if err = r .processEnvoyPatchPolicies (ctx , gwcResource , resourceMappings ); err != nil {
230
- return reconcile.Result {}, err
231
+ r .log .Error (err , fmt .Sprintf ("failed processEnvoyPatchPolicies for gatewayClass %s, skipping it" , managedGC .Name ))
232
+ continue
231
233
}
232
234
}
233
235
if r .ctpCRDExists {
234
236
// Add all ClientTrafficPolicies and their referenced resources to the resourceTree
235
237
if err = r .processClientTrafficPolicies (ctx , gwcResource , resourceMappings ); err != nil {
236
- return reconcile.Result {}, err
238
+ r .log .Error (err , fmt .Sprintf ("failed processClientTrafficPolicies for gatewayClass %s, skipping it" , managedGC .Name ))
239
+ continue
237
240
}
238
241
}
239
242
240
243
if r .btpCRDExists {
241
244
// Add all BackendTrafficPolicies to the resourceTree
242
245
if err = r .processBackendTrafficPolicies (ctx , gwcResource , resourceMappings ); err != nil {
243
- return reconcile.Result {}, err
246
+ r .log .Error (err , fmt .Sprintf ("failed processBackendTrafficPolicies for gatewayClass %s, skipping it" , managedGC .Name ))
247
+ continue
244
248
}
245
249
}
246
250
247
251
if r .spCRDExists {
248
252
// Add all SecurityPolicies and their referenced resources to the resourceTree
249
253
if err = r .processSecurityPolicies (ctx , gwcResource , resourceMappings ); err != nil {
250
- return reconcile.Result {}, err
254
+ r .log .Error (err , fmt .Sprintf ("failed processSecurityPolicies for gatewayClass %s, skipping it" , managedGC .Name ))
255
+ continue
251
256
}
252
257
}
253
258
254
259
if r .bTLSPolicyCRDExists {
255
260
// Add all BackendTLSPolies to the resourceTree
256
261
if err = r .processBackendTLSPolicies (ctx , gwcResource , resourceMappings ); err != nil {
257
- return reconcile.Result {}, err
262
+ r .log .Error (err , fmt .Sprintf ("failed processBackendTLSPolicies for gatewayClass %s, skipping it" , managedGC .Name ))
263
+ continue
258
264
}
259
265
}
260
266
261
267
if r .eepCRDExists {
262
268
// Add all EnvoyExtensionPolicies and their referenced resources to the resourceTree
263
269
if err = r .processEnvoyExtensionPolicies (ctx , gwcResource , resourceMappings ); err != nil {
264
- return reconcile.Result {}, err
270
+ r .log .Error (err , fmt .Sprintf ("failed processEnvoyExtensionPolicies for gatewayClass %s, skipping it" , managedGC .Name ))
271
+ continue
265
272
}
266
273
}
267
274
268
275
if err = r .processExtensionServerPolicies (ctx , gwcResource ); err != nil {
269
- return reconcile.Result {}, err
276
+ r .log .Error (err , fmt .Sprintf ("failed processExtensionServerPolicies for gatewayClass %s, skipping it" , managedGC .Name ))
277
+ continue
270
278
}
271
279
272
280
if r .backendCRDExists {
273
281
if err = r .processBackends (ctx , gwcResource ); err != nil {
274
- return reconcile.Result {}, err
282
+ r .log .Error (err , fmt .Sprintf ("failed processBackends for gatewayClass %s, skipping it" , managedGC .Name ))
283
+ continue
275
284
}
276
285
}
277
286
@@ -287,9 +296,9 @@ func (r *gatewayAPIReconciler) Reconcile(ctx context.Context, _ reconcile.Reques
287
296
if err != nil {
288
297
r .log .Error (err , "unable to find the namespace" )
289
298
if kerrors .IsNotFound (err ) {
290
- return reconcile. Result {}, nil
299
+ continue
291
300
}
292
- return reconcile. Result {}, err
301
+ continue
293
302
}
294
303
295
304
gwcResource .Namespaces = append (gwcResource .Namespaces , namespace )
@@ -313,20 +322,20 @@ func (r *gatewayAPIReconciler) Reconcile(ctx context.Context, _ reconcile.Reques
313
322
r .resources .GatewayClassStatuses .Store (utils .NamespacedName (gc ), & gc .Status )
314
323
315
324
if len (gwcResource .Gateways ) == 0 {
316
- r .log .Info ("No gateways found for accepted gatewayclass " )
325
+ r .log .Info ("No gateways found for accepted gatewayClass " )
317
326
318
327
// If needed, remove the finalizer from the accepted GatewayClass.
319
328
if err := r .removeFinalizer (ctx , managedGC ); err != nil {
320
- r .log .Error (err , fmt .Sprintf ("failed to remove finalizer from gatewayclass %s" ,
329
+ r .log .Error (err , fmt .Sprintf ("failed to remove finalizer from gatewayClass %s" ,
321
330
managedGC .Name ))
322
- return reconcile. Result {}, err
331
+ continue
323
332
}
324
333
} else {
325
334
// finalize the accepted GatewayClass.
326
335
if err := r .addFinalizer (ctx , managedGC ); err != nil {
327
- r .log .Error (err , fmt .Sprintf ("failed adding finalizer to gatewayclass %s" ,
336
+ r .log .Error (err , fmt .Sprintf ("failed adding finalizer to gatewayClass %s" ,
328
337
managedGC .Name ))
329
- return reconcile. Result {}, err
338
+ continue
330
339
}
331
340
}
332
341
}
@@ -952,7 +961,7 @@ func (r *gatewayAPIReconciler) processGateways(ctx context.Context, managedGC *g
952
961
if err := r .client .List (ctx , gatewayList , & client.ListOptions {
953
962
FieldSelector : fields .OneTermEqualSelector (classGatewayIndex , managedGC .Name ),
954
963
}); err != nil {
955
- r .log .Info ( "no associated Gateways found for GatewayClass" , "name " , managedGC .Name )
964
+ r .log .Error ( err , "failed to list gateways for gatewayClass %s " , managedGC .Name )
956
965
return err
957
966
}
958
967
0 commit comments