I'd rather have the controllers' use of informers focused on reconciliation. In the case of the NetworkConfig, I feel like we could do this by:
- Exposing
SetNetworkConfig on the revision controller
- In
cmd/controller/main.go doing something like:
configMapInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{
UpdateFunc: func(_, obj interface{}) {
configMap := obj.(*corev1.ConfigMap)
if isNetworkConfig(configMap) {
revisionController.SetNetworkConfig(NewNetworkConfigFromConfigMap(configMap))
return
}
// handle other configmaps being routed to other controllers
})
I'd rather have the controllers' use of informers focused on reconciliation. In the case of the
NetworkConfig, I feel like we could do this by:SetNetworkConfigon the revision controllercmd/controller/main.godoing something like: