Skip to content

Commit bf8e9d9

Browse files
lambdaiistio-testing
authored andcommitted
pilot: add traffic direction to listener (#16080)
* pilot: add traffic direction to listener * mod and vendor * fix direction for gateway remove the direction field from listenerOpt Signed-off-by: Yuchen Dai <silentdai@gmail.com>
1 parent e9634e2 commit bf8e9d9

File tree

69 files changed

+8055
-4019
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+8055
-4019
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ require (
5454
github.com/elazarl/goproxy v0.0.0-20190421051319-9d40249d3c2f // indirect
5555
github.com/elazarl/goproxy/ext v0.0.0-20190421051319-9d40249d3c2f // indirect
5656
github.com/emicklei/go-restful v2.6.0+incompatible
57-
github.com/envoyproxy/go-control-plane v0.8.4
57+
github.com/envoyproxy/go-control-plane v0.8.5
5858
github.com/evanphx/json-patch v3.0.0+incompatible
5959
github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 // indirect
6060
github.com/facebookgo/stackerr v0.0.0-20150612192056-c2fcf88613f4 // indirect

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ github.com/emicklei/go-restful v2.6.0+incompatible h1:luAX89wpjId5gV+GJV11MFD56G
123123
github.com/emicklei/go-restful v2.6.0+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs=
124124
github.com/envoyproxy/go-control-plane v0.8.4 h1:moNlmfa71yZkzDxAb4Fz5qwaW1giZmTtwn6P/gYIK6E=
125125
github.com/envoyproxy/go-control-plane v0.8.4/go.mod h1:XB9+ce7x+IrsjgIVnRnql0O61gj/np0/bGDfhJI3sCU=
126+
github.com/envoyproxy/go-control-plane v0.8.5 h1:YoOj1XYqT+pSFtVUYbmGYUmDZVdobz1EZ3Yiu0WOfFI=
127+
github.com/envoyproxy/go-control-plane v0.8.5/go.mod h1:XB9+ce7x+IrsjgIVnRnql0O61gj/np0/bGDfhJI3sCU=
126128
github.com/envoyproxy/protoc-gen-validate v0.0.0-20190405222122-d6164de49109 h1:FNgqGzbOm637YKRbYGKb9cqGo8i50++w/LWvMau7jrw=
127129
github.com/envoyproxy/protoc-gen-validate v0.0.0-20190405222122-d6164de49109/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
128130
github.com/evanphx/json-patch v3.0.0+incompatible h1:l91aby7TzBXBdmF8heZqjskeH9f3g7ZOL8/sSe+vTlU=

pilot/pkg/networking/core/v1alpha3/gateway.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ func (configgen *ConfigGeneratorImpl) buildGatewayListeners(
113113
}
114114

115115
l := buildListener(opts)
116+
l.TrafficDirection = core.TrafficDirection_OUTBOUND
117+
116118
mutable := &plugin.MutableObjects{
117119
Listener: l,
118120
// Note: buildListener creates filter chains but does not populate the filters in the chain; that's what

pilot/pkg/networking/core/v1alpha3/listener.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,8 @@ func (configgen *ConfigGeneratorImpl) buildSidecarInboundListenerForPortOrUDS(no
482482

483483
// call plugins
484484
l := buildListener(listenerOpts)
485+
l.TrafficDirection = core.TrafficDirection_INBOUND
486+
485487
mutable := &plugin.MutableObjects{
486488
Listener: l,
487489
FilterChains: make([]plugin.FilterChain, len(l.FilterChains)),
@@ -773,6 +775,7 @@ func (configgen *ConfigGeneratorImpl) buildSidecarOutboundListeners(env *model.E
773775
tcpListeners = append(tcpListeners, httpListeners...)
774776
httpProxy := configgen.buildHTTPProxy(env, node, push, node.ServiceInstances)
775777
if httpProxy != nil {
778+
httpProxy.TrafficDirection = core.TrafficDirection_OUTBOUND
776779
tcpListeners = append(tcpListeners, httpProxy)
777780
}
778781

@@ -823,6 +826,7 @@ func (configgen *ConfigGeneratorImpl) buildHTTPProxy(env *model.Environment, nod
823826
skipUserFilters: true,
824827
}
825828
l := buildListener(opts)
829+
826830
// TODO: plugins for HTTP_PROXY mode, envoyfilter needs another listener match for SIDECAR_HTTP_PROXY
827831
// there is no mixer for http_proxy
828832
mutable := &plugin.MutableObjects{
@@ -1096,6 +1100,7 @@ func (configgen *ConfigGeneratorImpl) buildSidecarOutboundListenerForPortOrUDS(l
10961100
// merge the filter chains with any existing listener on the same port/bind point
10971101
l := buildListener(listenerOpts)
10981102
appendListenerFallthroughRoute(l, &listenerOpts, pluginParams.Node, currentListenerEntry)
1103+
l.TrafficDirection = core.TrafficDirection_OUTBOUND
10991104

11001105
mutable := &plugin.MutableObjects{
11011106
Listener: l,
@@ -1382,6 +1387,7 @@ func buildSidecarInboundMgmtListeners(node *model.Proxy, env *model.Environment,
13821387
skipUserFilters: true,
13831388
}
13841389
l := buildListener(listenerOpts)
1390+
l.TrafficDirection = core.TrafficDirection_INBOUND
13851391
mutable := &plugin.MutableObjects{
13861392
Listener: l,
13871393
FilterChains: []plugin.FilterChain{{}},

vendor/github.com/envoyproxy/go-control-plane/envoy/admin/v2alpha/certs.pb.validate.go

Lines changed: 66 additions & 36 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)