From be4705faa3f45794eb6cfe2b57ac3dfcb394460c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charles-Edouard=20Br=C3=A9t=C3=A9ch=C3=A9?= Date: Mon, 25 Nov 2024 11:48:58 +0100 Subject: [PATCH] fix: use deleteOptions in cleanup controller (#11662) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Charles-Edouard Brétéché --- pkg/controllers/cleanup/controller.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/controllers/cleanup/controller.go b/pkg/controllers/cleanup/controller.go index 165c3273d8..13d1cb1c08 100644 --- a/pkg/controllers/cleanup/controller.go +++ b/pkg/controllers/cleanup/controller.go @@ -309,7 +309,7 @@ func (c *controller) cleanup(ctx context.Context, logger logr.Logger, policy kyv labels = append(labels, attribute.String("deletion_policy", string(*deleteOptions.PropagationPolicy))) } logger.WithValues("name", name, "namespace", namespace).Info("resource matched, it will be deleted...") - if err := c.client.DeleteResource(ctx, resource.GetAPIVersion(), resource.GetKind(), namespace, name, false, metav1.DeleteOptions{}); err != nil { + if err := c.client.DeleteResource(ctx, resource.GetAPIVersion(), resource.GetKind(), namespace, name, false, deleteOptions); err != nil { if c.metrics.cleanupFailuresTotal != nil { c.metrics.cleanupFailuresTotal.Add(ctx, 1, metric.WithAttributes(labels...)) }