Skip to content

Commit

Permalink
Simplify comments
Browse files Browse the repository at this point in the history
Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com>
  • Loading branch information
kaovilai committed Feb 2, 2024
1 parent 2f25c25 commit 1cc0f89
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions pkg/util/kube/event_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 1cc0f89

Please sign in to comment.