Skip to content

Commit e9ed331

Browse files
authored
Merge pull request #895 from fluxcd/delete-cache-entries
Delete cache entries on object deletion
2 parents 80cb694 + 640aa7a commit e9ed331

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

internal/controller/imageupdateautomation_controller.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,9 @@ func (r *ImageUpdateAutomationReconciler) reconcileDelete(obj *imagev1.ImageUpda
520520
// Remove our finalizer from the list.
521521
controllerutil.RemoveFinalizer(obj, imagev1.ImageUpdateAutomationFinalizer)
522522

523+
// Cleanup caches.
524+
r.tokenCache.DeleteEventsForObject(imagev1.ImageUpdateAutomationKind, obj.GetName(), obj.GetNamespace())
525+
523526
// Stop reconciliation as the object is being deleted.
524527
return ctrl.Result{}, nil
525528
}

0 commit comments

Comments
 (0)