-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
switch MCP watching to full EventHandler implementation
The main motivation behind this is to give ourselves much more transparency and control over when precisely we reconcile on an MCP change. The EnqueueRequestsFromMapFunc() based mechanism used so far invokes the registered function (mapKataConfigToRequests()) on any and all MCP changes. Combined with the mapKataConfigToRequests() implementation that filed a reconcile.Request any time it was invoked without discrimination we were triggering unnecessarily many reconciliations. With this change, we only reconcile on relevant MCP changes ("worker" and "kata-oc") unlike so far when we reconciled on any MCP change, however unrelated to this controller the changed MCP might have been. In addition, we only reconcile on MCP update since reconciling on MCP creation or deletion doesn't seem useful to this controller. We also guard against spurious MCP changes that are irrelevant to us (e.g. timestamps) by making sure that we only reconcile when values actually used by the controller change (machine counts and Updating/Updated conditions). Signed-off-by: Pavel Mores <pmores@redhat.com>
- Loading branch information
Pavel Mores
authored and
Pavel Mores
committed
Mar 2, 2023
1 parent
ef92c21
commit ab11dce
Showing
1 changed file
with
164 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters