Start Ingress cache Controller immediately

This commit is contained in:
Antoine Cotten 2018-03-28 11:14:45 +02:00
parent 6bc4dad38a
commit b42dcbeb20
No known key found for this signature in database
GPG key ID: EA06C9A94E2B3EA0

View file

@ -141,13 +141,15 @@ type Controller struct {
// Run initiates the synchronization of the controllers against the api server
func (c *Controller) Run(stopCh chan struct{}) {
go c.Ingress.Run(stopCh)
go c.Endpoint.Run(stopCh)
go c.Service.Run(stopCh)
go c.Secret.Run(stopCh)
go c.Configmap.Run(stopCh)
// Wait for all involved caches to be synced, before processing items from the queue is started
// Wait for all involved caches to be synced before processing items from the queue
if !cache.WaitForCacheSync(stopCh,
c.Ingress.HasSynced,
c.Endpoint.HasSynced,
c.Service.HasSynced,
c.Secret.HasSynced,
@ -155,16 +157,6 @@ func (c *Controller) Run(stopCh chan struct{}) {
) {
runtime.HandleError(fmt.Errorf("Timed out waiting for caches to sync"))
}
// We need to wait before start syncing the ingress rules
// because the rules requires content from other listers
time.Sleep(1 * time.Second)
go c.Ingress.Run(stopCh)
if !cache.WaitForCacheSync(stopCh,
c.Ingress.HasSynced,
) {
runtime.HandleError(fmt.Errorf("Timed out waiting for caches to sync"))
}
}
// k8sStore internal Storer implementation using informers and thread safe stores