Description
When the CAPIProvider
resource removes the applyHash
annotation from the applied CAPI Operator provider, the operator code unnecessarily initiates a full reconciliation cycle. This cycle involves constructing an unnecessary files cache and performing costly processing, conversions, and replacements, as demonstrated in the profiling stub.
Since the configuration map with the data has already been created and won’t change during this cycle, reconciliation shouldn’t occur.
To address this we should store the templated and fully modified content of the provider manifests in a secret and use this secret as cache instead. In addition to that that secret should act as a source for hash notation which now needs to be calculated based on secret data.
This change would reduce the need to perform memory-intensive managers construction, which caches file content and requires upstream modifications.
Current approach is implemented in kubernetes-sigs/cluster-api-operator#827
Outstanding work:
- Fix unit tests for upgrade
- Move implementation into phase
- Replace applied hash annotation logic from ConfigMap to a new secret cache #138