mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-05 15:37:19 +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)))
|
labels = append(labels, attribute.String("deletion_policy", string(*deleteOptions.PropagationPolicy)))
|
||||||
}
|
}
|
||||||
logger.WithValues("name", name, "namespace", namespace).Info("resource matched, it will be deleted...")
|
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 {
|
if c.metrics.cleanupFailuresTotal != nil {
|
||||||
c.metrics.cleanupFailuresTotal.Add(ctx, 1, metric.WithAttributes(labels...))
|
c.metrics.cleanupFailuresTotal.Add(ctx, 1, metric.WithAttributes(labels...))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue