Description
When processing updates to cluster resources, for some resources, we check their generation
, so that we don't trigger state change (graph rebuild) if the generation didn't change. This is a performance optimization so that we don't rebuild the graph and as a result do not regenerate NGINX config and reload it.
However, for resources don't trigger state change on upsert, but for which the relationship capturer or triggerStateChange
func determines if the resource triggers a change, we don't check the resource generation.
We can also filter resource events at the controller level by adding the controller-runtime GenerationChangedPredicate. This would eliminate the need to check the generation in the changeTrackingUpdater
and reduce the number of events we process. Adding this predicate may not make sense for all the resources since the generation of a resource is only incremented for spec changes. Changes to metadata -- such as labels and annotations -- do not increment the generation.
Acceptance criteria:
- check generation for those cases above