From 90fc30c328a1aff479d7499506195802f4c12830 Mon Sep 17 00:00:00 2001 From: Manuel de Brito Fontes Date: Mon, 21 Aug 2017 17:18:30 -0300 Subject: [PATCH] Add initial sync of secrets --- core/pkg/ingress/controller/controller.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/pkg/ingress/controller/controller.go b/core/pkg/ingress/controller/controller.go index a6b2d0b54..21a2fe5ad 100644 --- a/core/pkg/ingress/controller/controller.go +++ b/core/pkg/ingress/controller/controller.go @@ -1298,6 +1298,14 @@ func (ic GenericController) Start() { runtime.HandleError(fmt.Errorf("Timed out waiting for caches to sync")) } + // initial sync of secrets to avoid unnecessary reloads + for _, key := range ic.ingLister.ListKeys() { + if obj, exists, _ := ic.ingLister.GetByKey(key); exists { + ing := obj.(*extensions.Ingress) + ic.readSecrets(ing) + } + } + go ic.syncQueue.Run(time.Second, ic.stopCh) if ic.syncStatus != nil {