Reputation: 405
I've developed an operator to listen for reconcile events for a particular CRD (API). Currently, during startup, the operator reconciles all existing CRs one by one. There might be scenarios where, upon the operator restarts, there could already be thousands of CRs in the cluster. I aim to prefetch all these CRs and process them before initializing the manager.
I attempted to utilize 'manager.getClient()' to fetch the APIs using that client before invoking the 'manager.Start()' method. However, this approach failed due to the error stating that the cache wasn't initialized.
What's the best practice I should adopt here to fetch all the CRs during startup before commencing the manager?
Upvotes: 2
Views: 31