From 9924389ea5831637137f8bbe8b115a27bc6adc36 Mon Sep 17 00:00:00 2001 From: Grzegorz Grasza Date: Thu, 2 Nov 2023 11:49:25 +0100 Subject: [PATCH] Fix error on CR deletion This closes #39, by returning nil instead of err --- controllers/barbicanapi_controller.go | 2 +- controllers/barbicankeystonelistener_controller.go | 2 +- controllers/barbicanworker_controller.go | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/controllers/barbicanapi_controller.go b/controllers/barbicanapi_controller.go index 8f37ae2..dc67f3c 100644 --- a/controllers/barbicanapi_controller.go +++ b/controllers/barbicanapi_controller.go @@ -90,7 +90,7 @@ func (r *BarbicanAPIReconciler) Reconcile(ctx context.Context, req ctrl.Request) if err != nil { if k8s_errors.IsNotFound(err) { // Object not found - return ctrl.Result{}, err + return ctrl.Result{}, nil } // Error reading the object - requeue the request. return ctrl.Result{}, err diff --git a/controllers/barbicankeystonelistener_controller.go b/controllers/barbicankeystonelistener_controller.go index 450a9ec..8eac902 100644 --- a/controllers/barbicankeystonelistener_controller.go +++ b/controllers/barbicankeystonelistener_controller.go @@ -70,7 +70,7 @@ func (r *BarbicanKeystoneListenerReconciler) Reconcile(ctx context.Context, req if err != nil { if k8s_errors.IsNotFound(err) { // Object not found - return ctrl.Result{}, err + return ctrl.Result{}, nil } // Error reading the object - requeue the request. return ctrl.Result{}, err diff --git a/controllers/barbicanworker_controller.go b/controllers/barbicanworker_controller.go index 90408db..2355a62 100644 --- a/controllers/barbicanworker_controller.go +++ b/controllers/barbicanworker_controller.go @@ -68,7 +68,8 @@ func (r *BarbicanWorkerReconciler) Reconcile(ctx context.Context, req ctrl.Reque err := r.Client.Get(ctx, req.NamespacedName, instance) if err != nil { if k8s_errors.IsNotFound(err) { - return ctrl.Result{}, err + // Object not found + return ctrl.Result{}, nil } // Error reading the object - requeue the request. return ctrl.Result{}, err