-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[release-4.18] nrop: controller: get rtestate from cluster just once
We used to get the current cluster state both when attempting to sync the machine config state in the OpenShift flow, and when attempting to sync the RTE daemonsets in both flows. Due to the way `rtestate.FromClient` works, we end up reading the full cluster state twice in the openshift flow, which is unnecessary and wasteful. The fix is to get the cluster state once in the higher level function and pass the state in the specific reconcile step functions. The machine config and daemonset functions touch not overlapping objects (bar bugs) so sharing the state between them is expected to be fine. In other words, we happen to fetch the state twice most likely because of oversight, not because a deliberate decision about data sharing/unsharing (which, should that be the case, would need some extra refactoring and more explicit code). Signed-off-by: Francesco Romani <[email protected]> (cherry picked from commit 835a9a8)
- Loading branch information
Showing
1 changed file
with
10 additions
and
11 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