Skip to content

Commit d379034

Browse files
lmicciniclaude
andcommitted
Fix FRR old namespace cleanup error handling in reconcileDelete
Return the error instead of just logging it when cleanup of FRRConfigurations from the old namespace fails during CR deletion. Without this, the finalizer is removed and the CR is garbage collected even if old-namespace FRRConfigurations were not successfully deleted, potentially leaving orphaned resources. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent fc58bcd commit d379034

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

internal/controller/network/bgpconfiguration_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ func (r *BGPConfigurationReconciler) reconcileDelete(ctx context.Context, instan
384384

385385
if frrNamespace != instance.Spec.FRRConfigurationNamespace {
386386
if err := r.cleanupOldNamespaceFRRConfigurations(ctx, instance, instance.Spec.FRRConfigurationNamespace); err != nil {
387-
Log.Error(err, "Failed to cleanup FRRConfigurations from old namespace", "namespace", instance.Spec.FRRConfigurationNamespace)
387+
return ctrl.Result{}, fmt.Errorf("error cleaning up FRRConfigurations from old namespace %s: %w", instance.Spec.FRRConfigurationNamespace, err)
388388
}
389389
}
390390

0 commit comments

Comments
 (0)