@@ -228,63 +228,72 @@ func (r *gatewayAPIReconciler) Reconcile(ctx context.Context, _ reconcile.Reques
228
228
string (gwapiv1 .GatewayClassReasonInvalidParameters ),
229
229
msg )
230
230
r .resources .GatewayClassStatuses .Store (utils .NamespacedName (gc ), & gc .Status )
231
- return reconcile. Result {}, nil
231
+ continue
232
232
}
233
233
}
234
234
235
235
// Add all Gateways, their associated Routes, and referenced resources to the resourceTree
236
236
if err = r .processGateways (ctx , managedGC , resourceMappings , gwcResource ); err != nil {
237
- return reconcile.Result {}, err
237
+ r .log .Error (err , fmt .Sprintf ("failed processGateways for gatewayClass %s, skipping it" , managedGC .Name ))
238
+ continue
238
239
}
239
240
240
241
if r .eppCRDExists {
241
242
// Add all EnvoyPatchPolicies to the resourceTree
242
243
if err = r .processEnvoyPatchPolicies (ctx , gwcResource , resourceMappings ); err != nil {
243
- return reconcile.Result {}, err
244
+ r .log .Error (err , fmt .Sprintf ("failed processEnvoyPatchPolicies for gatewayClass %s, skipping it" , managedGC .Name ))
245
+ continue
244
246
}
245
247
}
246
248
if r .ctpCRDExists {
247
249
// Add all ClientTrafficPolicies and their referenced resources to the resourceTree
248
250
if err = r .processClientTrafficPolicies (ctx , gwcResource , resourceMappings ); err != nil {
249
- return reconcile.Result {}, err
251
+ r .log .Error (err , fmt .Sprintf ("failed processClientTrafficPolicies for gatewayClass %s, skipping it" , managedGC .Name ))
252
+ continue
250
253
}
251
254
}
252
255
253
256
if r .btpCRDExists {
254
257
// Add all BackendTrafficPolicies to the resourceTree
255
258
if err = r .processBackendTrafficPolicies (ctx , gwcResource , resourceMappings ); err != nil {
256
- return reconcile.Result {}, err
259
+ r .log .Error (err , fmt .Sprintf ("failed processBackendTrafficPolicies for gatewayClass %s, skipping it" , managedGC .Name ))
260
+ continue
257
261
}
258
262
}
259
263
260
264
if r .spCRDExists {
261
265
// Add all SecurityPolicies and their referenced resources to the resourceTree
262
266
if err = r .processSecurityPolicies (ctx , gwcResource , resourceMappings ); err != nil {
263
- return reconcile.Result {}, err
267
+ r .log .Error (err , fmt .Sprintf ("failed processSecurityPolicies for gatewayClass %s, skipping it" , managedGC .Name ))
268
+ continue
264
269
}
265
270
}
266
271
267
272
if r .bTLSPolicyCRDExists {
268
273
// Add all BackendTLSPolies to the resourceTree
269
274
if err = r .processBackendTLSPolicies (ctx , gwcResource , resourceMappings ); err != nil {
270
- return reconcile.Result {}, err
275
+ r .log .Error (err , fmt .Sprintf ("failed processBackendTLSPolicies for gatewayClass %s, skipping it" , managedGC .Name ))
276
+ continue
271
277
}
272
278
}
273
279
274
280
if r .eepCRDExists {
275
281
// Add all EnvoyExtensionPolicies and their referenced resources to the resourceTree
276
282
if err = r .processEnvoyExtensionPolicies (ctx , gwcResource , resourceMappings ); err != nil {
277
- return reconcile.Result {}, err
283
+ r .log .Error (err , fmt .Sprintf ("failed processEnvoyExtensionPolicies for gatewayClass %s, skipping it" , managedGC .Name ))
284
+ continue
278
285
}
279
286
}
280
287
281
288
if err = r .processExtensionServerPolicies (ctx , gwcResource ); err != nil {
282
- return reconcile.Result {}, err
289
+ r .log .Error (err , fmt .Sprintf ("failed processExtensionServerPolicies for gatewayClass %s, skipping it" , managedGC .Name ))
290
+ continue
283
291
}
284
292
285
293
if r .backendCRDExists {
286
294
if err = r .processBackends (ctx , gwcResource ); err != nil {
287
- return reconcile.Result {}, err
295
+ r .log .Error (err , fmt .Sprintf ("failed processBackends for gatewayClass %s, skipping it" , managedGC .Name ))
296
+ continue
288
297
}
289
298
}
290
299
@@ -300,9 +309,9 @@ func (r *gatewayAPIReconciler) Reconcile(ctx context.Context, _ reconcile.Reques
300
309
if err != nil {
301
310
r .log .Error (err , "unable to find the namespace" )
302
311
if kerrors .IsNotFound (err ) {
303
- return reconcile. Result {}, nil
312
+ continue
304
313
}
305
- return reconcile. Result {}, err
314
+ continue
306
315
}
307
316
308
317
gwcResource .Namespaces = append (gwcResource .Namespaces , namespace )
@@ -326,20 +335,20 @@ func (r *gatewayAPIReconciler) Reconcile(ctx context.Context, _ reconcile.Reques
326
335
r .resources .GatewayClassStatuses .Store (utils .NamespacedName (gc ), & gc .Status )
327
336
328
337
if len (gwcResource .Gateways ) == 0 {
329
- r .log .Info ("No gateways found for accepted gatewayclass " )
338
+ r .log .Info ("No gateways found for accepted gatewayClass " )
330
339
331
340
// If needed, remove the finalizer from the accepted GatewayClass.
332
341
if err := r .removeFinalizer (ctx , managedGC ); err != nil {
333
- r .log .Error (err , fmt .Sprintf ("failed to remove finalizer from gatewayclass %s" ,
342
+ r .log .Error (err , fmt .Sprintf ("failed to remove finalizer from gatewayClass %s" ,
334
343
managedGC .Name ))
335
- return reconcile. Result {}, err
344
+ continue
336
345
}
337
346
} else {
338
347
// finalize the accepted GatewayClass.
339
348
if err := r .addFinalizer (ctx , managedGC ); err != nil {
340
- r .log .Error (err , fmt .Sprintf ("failed adding finalizer to gatewayclass %s" ,
349
+ r .log .Error (err , fmt .Sprintf ("failed adding finalizer to gatewayClass %s" ,
341
350
managedGC .Name ))
342
- return reconcile. Result {}, err
351
+ continue
343
352
}
344
353
}
345
354
}
@@ -1046,7 +1055,7 @@ func (r *gatewayAPIReconciler) processGateways(ctx context.Context, managedGC *g
1046
1055
if err := r .client .List (ctx , gatewayList , & client.ListOptions {
1047
1056
FieldSelector : fields .OneTermEqualSelector (classGatewayIndex , managedGC .Name ),
1048
1057
}); err != nil {
1049
- r .log .Info ( "no associated Gateways found for GatewayClass" , "name " , managedGC .Name )
1058
+ r .log .Error ( err , "failed to list gateways for gatewayClass %s " , managedGC .Name )
1050
1059
return err
1051
1060
}
1052
1061
0 commit comments