Check if item is really a task.Element

This commit is contained in:
Joao Morais 2017-09-27 21:33:23 -03:00
parent 62e000ebf2
commit 389c7055fa

View file

@ -238,19 +238,21 @@ func (ic GenericController) GetService(name string) (*apiv1.Service, error) {
// sync collects all the pieces required to assemble the configuration file and // sync collects all the pieces required to assemble the configuration file and
// then sends the content to the backend (OnUpdate) receiving the populated // then sends the content to the backend (OnUpdate) receiving the populated
// template as response reloading the backend if is required. // 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() ic.syncRateLimiter.Accept()
if ic.syncQueue.IsShuttingDown() { if ic.syncQueue.IsShuttingDown() {
return nil return nil
} }
if name, ok := element.(task.Element).Key.(string); ok { if element, ok := item.(task.Element); ok {
if name, ok := element.Key.(string); ok {
if obj, exists, _ := ic.listers.Ingress.GetByKey(name); exists { if obj, exists, _ := ic.listers.Ingress.GetByKey(name); exists {
ing := obj.(*extensions.Ingress) ing := obj.(*extensions.Ingress)
ic.readSecrets(ing) ic.readSecrets(ing)
} }
} }
}
// Sort ingress rules using the ResourceVersion field // Sort ingress rules using the ResourceVersion field
ings := ic.listers.Ingress.List() ings := ic.listers.Ingress.List()