Skip to content

Commit

Permalink
Avoid adding original_dst filter when not needed (#10302)
Browse files Browse the repository at this point in the history
  • Loading branch information
freddygv authored and hc-github-team-consul-core committed May 26, 2021
1 parent 54f7cc0 commit a2dcb96
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 16 deletions.
4 changes: 4 additions & 0 deletions .changelog/10302.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
```release-note:improvement
connect: Avoid adding original_dst listener filter when it won't be used.
```

13 changes: 7 additions & 6 deletions agent/xds/listeners.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,6 @@ func (s *ResourceGenerator) listenersFromSnapshotConnectProxy(cfgSnap *proxycfg.

outboundListener = makePortListener(OutboundListenerName, "127.0.0.1", port, envoy_core_v3.TrafficDirection_OUTBOUND)
outboundListener.FilterChains = make([]*envoy_listener_v3.FilterChain, 0)
outboundListener.ListenerFilters = []*envoy_listener_v3.ListenerFilter{
{
// TODO (freddy): Hard-coded until we upgrade the go-control-plane library
Name: "envoy.filters.listener.original_dst",
},
}
}

var hasFilterChains bool
Expand Down Expand Up @@ -207,6 +201,13 @@ func (s *ResourceGenerator) listenersFromSnapshotConnectProxy(cfgSnap *proxycfg.
if cfgSnap.ConnectProxy.MeshConfig == nil ||
!cfgSnap.ConnectProxy.MeshConfig.TransparentProxy.CatalogDestinationsOnly {

outboundListener.ListenerFilters = []*envoy_listener_v3.ListenerFilter{
{
// TODO (freddy): Hard-coded until we upgrade the go-control-plane library
Name: "envoy.filters.listener.original_dst",
},
}

filterChain, err := s.makeUpstreamFilterChainForDiscoveryChain(
"passthrough",
OriginalDestinationClusterName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,6 @@
]
}
],
"listenerFilters": [
{
"name": "envoy.filters.listener.original_dst"
}
],
"trafficDirection": "OUTBOUND"
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,6 @@
]
}
],
"listenerFilters": [
{
"name": "envoy.filters.listener.original_dst"
}
],
"trafficDirection": "OUTBOUND"
},
{
Expand Down

0 comments on commit a2dcb96

Please sign in to comment.