grafana / grafana-app-sdk

An SDK for developing apps for grafana using kubernetes-like storage and operators
Apache License 2.0
48 stars 8 forks source link

[operator] Add the ability to customize and disable the cache resync interval of the KubernetesBasedInformer #419

Closed IfSentient closed 2 months ago

IfSentient commented 2 months ago

This PR updates the operator.NewKubernetesBasedInformerWithFilters method to use a config object that includes both ListWatchOptions and a CacheResyncInterval duration, which is passed to the underlying cache.NewSharedIndexInformer call, allowing for customization of the cache resync interval instead of the default 30s that was hard-coded (and set to 30s due to an ancient copy/paste).

This value can also be set via simple.NewOperator with simple.OperatorConfig.InformerCacheResyncInterval.