Skip to content

Commit

Permalink
Emit events only for non-nil ingresses
Browse files Browse the repository at this point in the history
  • Loading branch information
skmatti committed Dec 3, 2019
1 parent f988163 commit 8ee385b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,8 @@ func (lbc *LoadBalancerController) sync(key string) error {
frontendGCAlgorithm := frontendGCAlgorithm(ingExists, ing)
// GC will find GCE resources that were used for this ingress and delete them.
err := lbc.ingSyncer.GC(allIngresses, ing, frontendGCAlgorithm)
if err != nil {
// Skip emitting an event if ingress does not exist as we cannot retrieve ingress namespace.
if err != nil && ingExists {
lbc.ctx.Recorder(ing.Namespace).Eventf(ing, apiv1.EventTypeWarning, "GC", fmt.Sprintf("Error during GC: %v", err))
}
return err
Expand Down

0 comments on commit 8ee385b

Please sign in to comment.