From 389c7055fa29aeacc67d5fdac1b79d3de5846e2a Mon Sep 17 00:00:00 2001 From: Joao Morais Date: Wed, 27 Sep 2017 21:33:23 -0300 Subject: [PATCH] Check if item is really a task.Element --- core/pkg/ingress/controller/controller.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/core/pkg/ingress/controller/controller.go b/core/pkg/ingress/controller/controller.go index 86128f66d..37df71a03 100644 --- a/core/pkg/ingress/controller/controller.go +++ b/core/pkg/ingress/controller/controller.go @@ -238,17 +238,19 @@ func (ic GenericController) GetService(name string) (*apiv1.Service, error) { // sync collects all the pieces required to assemble the configuration file and // then sends the content to the backend (OnUpdate) receiving the populated // template as response reloading the backend if is required. -func (ic *GenericController) syncIngress(element interface{}) error { +func (ic *GenericController) syncIngress(item interface{}) error { ic.syncRateLimiter.Accept() if ic.syncQueue.IsShuttingDown() { return nil } - if name, ok := element.(task.Element).Key.(string); ok { - if obj, exists, _ := ic.listers.Ingress.GetByKey(name); exists { - ing := obj.(*extensions.Ingress) - ic.readSecrets(ing) + if element, ok := item.(task.Element); ok { + if name, ok := element.Key.(string); ok { + if obj, exists, _ := ic.listers.Ingress.GetByKey(name); exists { + ing := obj.(*extensions.Ingress) + ic.readSecrets(ing) + } } }