BackupRepositories associated with a BSL are invalidated when BSL is (re-)created. (#7380)

* Add BackupRepositories invalidation on BSL Create
Simplify comments

Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com>

* Simplify

Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com>

---------

Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com>
This commit is contained in:
Tiger Kaovilai
2024-02-06 10:13:30 -05:00
committed by GitHub
parent a9e80d585a
commit a5c72a4866
3 changed files with 11 additions and 7 deletions
+2 -4
View File
@@ -26,10 +26,8 @@ import (
type MapUpdateFunc func(client.Object) []reconcile.Request
// EnqueueRequestsFromMapUpdateFunc is for the same purpose with EnqueueRequestsFromMapFunc.
// Merely, it is more friendly to updating the mapped objects in the MapUpdateFunc, because
// on Update event, MapUpdateFunc is called for only once with the new object, so if MapUpdateFunc
// does some update to the mapped objects, the update is done for once
// EnqueueRequestsFromMapUpdateFunc has the same purpose with handler.EnqueueRequestsFromMapFunc.
// MapUpdateFunc is simpler on Update event because mapAndEnqueue is called once with the new object. EnqueueRequestsFromMapFunc is called twice with the old and new object.
func EnqueueRequestsFromMapUpdateFunc(fn MapUpdateFunc) handler.EventHandler {
return &enqueueRequestsFromMapFunc{
toRequests: fn,