Skip to content

Commit 640aa7a

Browse files
committed
Delete cache entries on object deletion
Signed-off-by: Matheus Pimenta <[email protected]>
1 parent 80cb694 commit 640aa7a

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)