Skip to content

Commit

Permalink
Merge pull request #964 from skmatti/cherrypick-log-fix
Browse files Browse the repository at this point in the history
Cherrypick #963[Emit events only for non-nil ingresses] into release 1.8
  • Loading branch information
k8s-ci-robot authored Dec 4, 2019
2 parents aa1add9 + a4737bc commit 3e8d844
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 3e8d844

Please sign in to comment.