From c6730389d46f7f5c065009df5a98e989274b7eee Mon Sep 17 00:00:00 2001 From: Lukasz Zajaczkowski Date: Mon, 16 Dec 2024 15:32:52 +0100 Subject: [PATCH] improve Vulnerability Report Reconciler (#319) --- internal/controller/vulnerabilityreports_controller.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/controller/vulnerabilityreports_controller.go b/internal/controller/vulnerabilityreports_controller.go index 982a0d53..6db55c9c 100644 --- a/internal/controller/vulnerabilityreports_controller.go +++ b/internal/controller/vulnerabilityreports_controller.go @@ -43,6 +43,7 @@ func (r *VulnerabilityReportReconciler) Reconcile(ctx context.Context, req ctrl. } if !vulnerabilityReport.DeletionTimestamp.IsZero() { + r.reports.Remove(req.NamespacedName.String()) return ctrl.Result{}, nil } @@ -203,7 +204,6 @@ func (r *VulnerabilityReportReconciler) SetupWithManager(mgr ctrl.Manager) error logger.Error(err, "unable to upsert vulnerability reports") } else { logger.Info("upsert vulnerability reports") - r.reports.Clear() } } return false, nil