Merge pull request #895 from fluxcd/delete-cache-entries

Delete cache entries on object deletion
This commit is contained in:
Matheus Pimenta 2025-05-02 12:51:12 +01:00 committed by GitHub
commit e9ed331572
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 0 deletions

View File

@ -520,6 +520,9 @@ func (r *ImageUpdateAutomationReconciler) reconcileDelete(obj *imagev1.ImageUpda
// Remove our finalizer from the list.
controllerutil.RemoveFinalizer(obj, imagev1.ImageUpdateAutomationFinalizer)
// Cleanup caches.
r.tokenCache.DeleteEventsForObject(imagev1.ImageUpdateAutomationKind, obj.GetName(), obj.GetNamespace())
// Stop reconciliation as the object is being deleted.
return ctrl.Result{}, nil
}