diff --git a/controllers/ovncontroller_controller.go b/controllers/ovncontroller_controller.go index f2421fc4..6bce8969 100644 --- a/controllers/ovncontroller_controller.go +++ b/controllers/ovncontroller_controller.go @@ -137,6 +137,11 @@ func (r *OVNControllerReconciler) Reconcile(ctx context.Context, req ctrl.Reques // Always patch the instance status when exiting this function so we can persist any changes. defer func() { + // Don't update the status, if reconciler Panics + if r := recover(); r != nil { + Log.Info(fmt.Sprintf("panic during reconcile %v\n", r)) + panic(r) + } // update the Ready condition based on the sub conditions if instance.Status.Conditions.AllSubConditionIsTrue() { instance.Status.Conditions.MarkTrue( diff --git a/controllers/ovndbcluster_controller.go b/controllers/ovndbcluster_controller.go index 3204eae3..27e0f2d0 100644 --- a/controllers/ovndbcluster_controller.go +++ b/controllers/ovndbcluster_controller.go @@ -180,6 +180,11 @@ func (r *OVNDBClusterReconciler) Reconcile(ctx context.Context, req ctrl.Request // Always patch the instance status when exiting this function so we can persist any changes. defer func() { + // Don't update the status, if reconciler Panics + if r := recover(); r != nil { + Log.Info(fmt.Sprintf("panic during reconcile %v\n", r)) + panic(r) + } // update the Ready condition based on the sub conditions if instance.Status.Conditions.AllSubConditionIsTrue() { instance.Status.Conditions.MarkTrue( diff --git a/controllers/ovnnorthd_controller.go b/controllers/ovnnorthd_controller.go index d1b89283..ccfb5a3f 100644 --- a/controllers/ovnnorthd_controller.go +++ b/controllers/ovnnorthd_controller.go @@ -154,6 +154,11 @@ func (r *OVNNorthdReconciler) Reconcile(ctx context.Context, req ctrl.Request) ( // Always patch the instance status when exiting this function so we can persist any changes. defer func() { + // Don't update the status, if reconciler Panics + if r := recover(); r != nil { + Log.Info(fmt.Sprintf("panic during reconcile %v\n", r)) + panic(r) + } // update the Ready condition based on the sub conditions if instance.Status.Conditions.AllSubConditionIsTrue() { instance.Status.Conditions.MarkTrue(