Fix project sync interval in router
ResyncInterval is tunable param and it can go as low as 1 second.
@@ -79,13 +79,18 @@ func (f *RouterControllerFactory) Create(plugin router.Plugin, watchNodes, enabl
ProjectClient: f.ProjectClient,
ProjectLabels: f.ProjectLabels,
- // Check projects a bit more often than we resync events, so that we aren't always waiting
- // the maximum interval for new items to come into the list
- ProjectSyncInterval: f.ResyncInterval - 10*time.Second,
ProjectWaitInterval: 10 * time.Second,
ProjectRetries: 5,
}
+ // Check projects a bit more often than we resync events, so that we aren't always waiting
+ // the maximum interval for new items to come into the list
+ if f.ResyncInterval > 10*time.Second {
+ rc.ProjectSyncInterval = f.ResyncInterval - 10*time.Second
+ } else {
+ rc.ProjectSyncInterval = f.ResyncInterval
+ }
+
f.initInformers(rc)
f.processExistingItems(rc)
f.registerInformerEventHandlers(rc)
