in watcher/watcher.go [60:87]
func (w *Watcher) Watch() error {
//================= Watch for Ingress ==================
igHandler := IgHandler{"ingresses", w.Ep}
igListWatch := cache.NewListWatchFromClient(w.Cs.NetworkingV1().RESTClient(), igHandler.GetResourceName(), v1.NamespaceAll, fields.Everything())
err := w.allNamespacesWatchFor(&igHandler, w.Cs.NetworkingV1().RESTClient(),
fields.Everything(), &nv1.Ingress{}, w.ResyncPeriod, igListWatch)
if err != nil {
return err
}
//================= Watch for Endpoints =================
epHandler := EpHandler{"endpoints", w.Ep}
epListWatch := cache.NewListWatchFromClient(w.Cs.CoreV1().RESTClient(), epHandler.GetResourceName(), v1.NamespaceAll, fields.Everything())
err = w.allNamespacesWatchFor(&epHandler, w.Cs.CoreV1().RESTClient(),
fields.Everything(), &v1.Endpoints{}, w.ResyncPeriod, epListWatch)
if err != nil {
return err
}
//================= Watch for ConfigMaps =================
cmHandler := CMHandler{"configmaps", w.Ep}
targetNs := make([]string, 1)
targetNs[0] = w.Ep.ATSManager.(*proxy.ATSManager).Namespace
err = w.inNamespacesWatchFor(&cmHandler, w.Cs.CoreV1().RESTClient(),
targetNs, fields.Everything(), &v1.ConfigMap{}, w.ResyncPeriod)
if err != nil {
return err
}
return nil
}