Skip to content

Commit

Permalink
Check if item is really a task.Element
Browse files Browse the repository at this point in the history
  • Loading branch information
jcmoraisjr committed Sep 28, 2017
1 parent 62e000e commit 389c705
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions core/pkg/ingress/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
}

Expand Down

0 comments on commit 389c705

Please sign in to comment.