From fd43955f9c24245728395d162d3be754dfc096fc Mon Sep 17 00:00:00 2001 From: Ming Wang Date: Thu, 9 Nov 2023 16:36:35 -0500 Subject: [PATCH] cleanup --- internal/controllers/common/finalizer_utils.go | 4 ++-- internal/controllers/reconciler.go | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/controllers/common/finalizer_utils.go b/internal/controllers/common/finalizer_utils.go index dc36890fa..02bd1d671 100644 --- a/internal/controllers/common/finalizer_utils.go +++ b/internal/controllers/common/finalizer_utils.go @@ -22,7 +22,7 @@ import ( ) // AddFinalizer adds the provided finalizer to the object and updates it in the cluster -func AddFinalizer(ctx context.Context, client client.Client, obj controllerutil.Object, finalizer string) error { +func AddFinalizer(ctx context.Context, client client.Client, obj client.Object, finalizer string) error { log.Info("adding finalizer to object", "namespace", obj.GetNamespace(), "name", obj.GetName()) controllerutil.AddFinalizer(obj, finalizer) err := client.Update(ctx, obj) @@ -35,7 +35,7 @@ func AddFinalizer(ctx context.Context, client client.Client, obj controllerutil. } // RemoveFinalizer removes the provided finalizer from the object and updates it in the cluster -func RemoveFinalizer(ctx context.Context, client client.Client, obj controllerutil.Object, finalizer string) error { +func RemoveFinalizer(ctx context.Context, client client.Client, obj client.Object, finalizer string) error { log.Info("removing finalizer from object", "namespace", obj.GetNamespace(), "name", obj.GetName()) controllerutil.RemoveFinalizer(obj, finalizer) err := client.Update(ctx, obj) diff --git a/internal/controllers/reconciler.go b/internal/controllers/reconciler.go index 7cff16efd..1bcd321dc 100644 --- a/internal/controllers/reconciler.go +++ b/internal/controllers/reconciler.go @@ -161,6 +161,7 @@ func (r *Reconciler) reconcile(ctx context.Context, cr *model.CryostatInstance) return reconcile.Result{}, err } + // Finalizer for CA Cert secrets err = r.finalizeTLS(ctx, cr) if err != nil { return reconcile.Result{}, err