From d82e7e8c2a20a273848a6fb382624e6daff877ff Mon Sep 17 00:00:00 2001 From: freddygv Date: Thu, 16 Apr 2020 19:08:41 -0600 Subject: [PATCH] Fix listener error handling --- agent/xds/listeners.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/agent/xds/listeners.go b/agent/xds/listeners.go index 018680f1f9..e6de118cc4 100644 --- a/agent/xds/listeners.go +++ b/agent/xds/listeners.go @@ -259,7 +259,9 @@ func (s *Server) listenersFromSnapshotGateway(cfgSnap *proxycfg.ConfigSnapshot, return nil, err } } - resources = append(resources, l) + if l != nil { + resources = append(resources, l) + } } return resources, err } @@ -600,6 +602,9 @@ func (s *Server) makeTerminatingGatewayListener(name, addr string, port int, cfg } err = injectConnectFilters(cfgSnap, token, l, false) + if err != nil { + return nil, fmt.Errorf("failed to inject authz filer: %v", err) + } // This fallback catch-all filter ensures a listener will be present for health checks to pass // Envoy will reset these connections since known endpoints are caught by filter chain matches above