ricoberger / vault-secrets-operator

Create Kubernetes secrets from Vault for a secure GitOps based workflow.
MIT License
633 stars 103 forks source link

Metrics not cleaned up after secret removal #243

Closed zeeZ closed 10 months ago

zeeZ commented 10 months ago

While deleting a namespace, the controller tried to reconcile a few secrets and rightfully received a secrets ... is forbidden: unable to create new content in namespace ... because it is being terminated.

The vaultsecrets_reconciliation_status metrics are now stuck at 0, and the vaultsecrets_reconciliations_total for this namespace are also still around.

It would be neat if metrics for objects that no longer exist could be cleaned up.

ricoberger commented 10 months ago

Hi @zeeZ, I think it makes totally sense to clean up the metrics once a secret is deleted and implemented this in #245