mirror of
https://github.com/kyverno/kyverno.git
synced 2024-12-14 11:57:48 +00:00
fix: use deleteOptions in cleanup controller (#11662)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
This commit is contained in:
parent
70b50d755a
commit
be4705faa3
1 changed files with 1 additions and 1 deletions
|
@ -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...))
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue