Skip to content

Commit

Permalink
Update Envoy go-control-plane, Proxy and CNI (istio#11249)
Browse files Browse the repository at this point in the history
* Update Envoy go-control-plane, Proxy and CNI

This updates envoyproxy/go-control-plane to v0.6.7. This also updates
the Proxy SHA to 7738fa3d5 and CNI SHA to de2ae6dc.

There are several locations where endpoint.Endpoint is either wrapped in
a with a endpoint.LbEndpoint_Endpoint or is being accessed via
LbEndpoint.GetEndpoint() without explicit checks on the HostIdentifier
type as this codebase doesn't use other types of the HostIdentifier as
yet.

Signed-off-by: Venil Noronha <[email protected]>

* Format codebase

This updates the codebase after running the formatter.

Signed-off-by: Venil Noronha <[email protected]>
  • Loading branch information
venilnoronha authored and rshriram committed Jan 25, 2019
1 parent a515477 commit 82e5848
Show file tree
Hide file tree
Showing 131 changed files with 9,941 additions and 6,515 deletions.
6 changes: 3 additions & 3 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ ignored = [

[[constraint]]
name = "github.com/envoyproxy/go-control-plane"
version = "^0.6.3"
version = "^0.6.7"

[[constraint]]
name = "github.com/fluent/fluent-logger-golang"
Expand Down
4 changes: 2 additions & 2 deletions istio.deps
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"name": "PROXY_REPO_SHA",
"repoName": "proxy",
"file": "",
"lastStableSHA": "d2d0c62a045d12924180082e8e4b6fbe0a20de1d"
"lastStableSHA": "7738fa3d506d3a1a7be002c1f06377e6516bc245"
},
{
"_comment": "",
"name": "CNI_REPO_SHA",
"repoName": "cni",
"file": "",
"lastStableSHA": "2a46a60f8f14d0e17082977f2d097462a8bf7d91"
"lastStableSHA": "de2ae6dcce2cd3ac55823b9aa099c2b462a8ba6e"
}
]
16 changes: 9 additions & 7 deletions mixer/test/client/dynamic_attribute/dynamic_attribute_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,13 +199,15 @@ func TestDynamicAttribute(t *testing.T) {
},
},
},
Endpoint: &endpoint.Endpoint{
Address: &core.Address{Address: &core.Address_SocketAddress{
SocketAddress: &core.SocketAddress{
Address: "127.0.0.1",
PortSpecifier: &core.SocketAddress_PortValue{PortValue: uint32(s.Ports().BackendPort)},
},
}},
HostIdentifier: &endpoint.LbEndpoint_Endpoint{
Endpoint: &endpoint.Endpoint{
Address: &core.Address{Address: &core.Address_SocketAddress{
SocketAddress: &core.SocketAddress{
Address: "127.0.0.1",
PortSpecifier: &core.SocketAddress_PortValue{PortValue: uint32(s.Ports().BackendPort)},
},
}},
},
},
}},
}},
Expand Down
12 changes: 8 additions & 4 deletions pilot/pkg/networking/core/v1alpha3/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -373,8 +373,10 @@ func buildLocalityLbEndpoints(env *model.Environment, proxyNetworkView map[strin
}
host := util.BuildAddress(instance.Endpoint.Address, uint32(instance.Endpoint.Port))
ep := endpoint.LbEndpoint{
Endpoint: &endpoint.Endpoint{
Address: &host,
HostIdentifier: &endpoint.LbEndpoint_Endpoint{
Endpoint: &endpoint.Endpoint{
Address: &host,
},
},
LoadBalancingWeight: &types.UInt32Value{
Value: 1,
Expand Down Expand Up @@ -402,8 +404,10 @@ func buildLocalityLbEndpoints(env *model.Environment, proxyNetworkView map[strin
func buildInboundLocalityLbEndpoints(bind string, port int) []endpoint.LocalityLbEndpoints {
address := util.BuildAddress(bind, uint32(port))
lbEndpoint := endpoint.LbEndpoint{
Endpoint: &endpoint.Endpoint{
Address: &address,
HostIdentifier: &endpoint.LbEndpoint_Endpoint{
Endpoint: &endpoint.Endpoint{
Address: &address,
},
},
}
return []endpoint.LocalityLbEndpoints{
Expand Down
8 changes: 4 additions & 4 deletions pilot/pkg/networking/core/v1alpha3/route/retry/retry.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ import (
)

// DefaultPolicy gets a copy of the default retry policy.
func DefaultPolicy() *route.RouteAction_RetryPolicy {
policy := route.RouteAction_RetryPolicy{
func DefaultPolicy() *route.RetryPolicy {
policy := route.RetryPolicy{
NumRetries: &types.UInt32Value{Value: 10},
RetryOn: "connect-failure,refused-stream,unavailable,cancelled,resource-exhausted",
RetriableStatusCodes: []uint32{http.StatusServiceUnavailable},
RetryHostPredicate: []*route.RouteAction_RetryPolicy_RetryHostPredicate{
RetryHostPredicate: []*route.RetryPolicy_RetryHostPredicate{
{
// to configure retries to prefer hosts that haven’t been attempted already,
// the builtin `envoy.retry_host_predicates.previous_hosts` predicate can be used.
Expand All @@ -58,7 +58,7 @@ func DefaultPolicy() *route.RouteAction_RetryPolicy {
// is appended when encountering parts that are valid HTTP status codes.
//
// - PerTryTimeout: set from in.PerTryTimeout (if specified)
func ConvertPolicy(in *networking.HTTPRetry) *route.RouteAction_RetryPolicy {
func ConvertPolicy(in *networking.HTTPRetry) *route.RetryPolicy {
if in == nil {
// No policy was set, use a default.
return DefaultPolicy()
Expand Down
4 changes: 3 additions & 1 deletion pilot/pkg/networking/core/v1alpha3/route/route.go
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,9 @@ func translateCORSPolicy(in *networking.CorsPolicy) *route.CorsPolicy {

out := route.CorsPolicy{
AllowOrigin: in.AllowOrigin,
Enabled: proto.BoolTrue,
EnabledSpecifier: &route.CorsPolicy_Enabled{
Enabled: proto.BoolTrue,
},
}
out.AllowCredentials = in.AllowCredentials
out.AllowHeaders = strings.Join(in.AllowHeaders, ",")
Expand Down
4 changes: 3 additions & 1 deletion pilot/pkg/networking/plugin/mixer/mixer.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,9 @@ func (mixerplugin) OnOutboundCluster(in *plugin.InputParams, cluster *xdsapi.Clu
{
LbEndpoints: []e.LbEndpoint{
{
Endpoint: &e.Endpoint{Address: &addr},
HostIdentifier: &e.LbEndpoint_Endpoint{
Endpoint: &e.Endpoint{Address: &addr},
},
},
},
},
Expand Down
4 changes: 2 additions & 2 deletions pilot/pkg/proxy/envoy/v2/ads_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,8 @@ func TestAdsUpdate(t *testing.T) {
if len(lbe) == 0 {
t.Fatal("No lb endpoints")
}
if "10.2.0.1" != lbe[0].Endpoint.Address.GetSocketAddress().Address {
t.Error("Expecting 10.2.0.1 got ", lbe[0].Endpoint.Address.GetSocketAddress().Address)
if "10.2.0.1" != lbe[0].GetEndpoint().Address.GetSocketAddress().Address {
t.Error("Expecting 10.2.0.1 got ", lbe[0].GetEndpoint().Address.GetSocketAddress().Address)
}
strResponse, _ := model.ToJSONWithIndent(res1, " ")
_ = ioutil.WriteFile(env.IstioOut+"/edsv2_sidecar.json", []byte(strResponse), 0644)
Expand Down
12 changes: 8 additions & 4 deletions pilot/pkg/proxy/envoy/v2/eds.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,10 @@ func buildEnvoyLbEndpoint(UID string, family model.AddressFamily, address string
}

ep := &endpoint.LbEndpoint{
Endpoint: &endpoint.Endpoint{
Address: &addr,
HostIdentifier: &endpoint.LbEndpoint_Endpoint{
Endpoint: &endpoint.Endpoint{
Address: &addr,
},
},
}

Expand All @@ -133,8 +135,10 @@ func networkEndpointToEnvoyEndpoint(e *model.NetworkEndpoint) (*endpoint.LbEndpo
}
addr := util.GetNetworkEndpointAddress(e)
ep := &endpoint.LbEndpoint{
Endpoint: &endpoint.Endpoint{
Address: &addr,
HostIdentifier: &endpoint.LbEndpoint_Endpoint{
Endpoint: &endpoint.Endpoint{
Address: &addr,
},
},
}

Expand Down
2 changes: 1 addition & 1 deletion pilot/pkg/proxy/envoy/v2/eds_sh_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ func verifySplitHorizonResponse(t *testing.T, network string, sidecarID string,
for addr, weight := range expected.weights {
var match *endpoint.LbEndpoint
for _, ep := range lbEndpoints {
if ep.Endpoint.Address.GetSocketAddress().Address == addr {
if ep.GetEndpoint().Address.GetSocketAddress().Address == addr {
match = &ep
break
}
Expand Down
2 changes: 1 addition & 1 deletion pilot/pkg/proxy/envoy/v2/eds_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func testTCPEndpoints(expected string, adsc *adsc.ADSC, t *testing.T) {
for _, lbe := range lbe.Endpoints {
for _, e := range lbe.LbEndpoints {
total++
if expected == e.Endpoint.Address.GetSocketAddress().Address {
if expected == e.GetEndpoint().Address.GetSocketAddress().Address {
return
}
}
Expand Down
6 changes: 4 additions & 2 deletions pilot/pkg/proxy/envoy/v2/ep_filters.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,10 @@ func EndpointsByNetworkFilter(endpoints []endpoint.LocalityLbEndpoints, conn *Xd
if gwIP := net.ParseIP(gw.GetAddress()); gwIP != nil {
addr := util.BuildAddress(gw.GetAddress(), gw.Port)
gwEp = &endpoint.LbEndpoint{
Endpoint: &endpoint.Endpoint{
Address: &addr,
HostIdentifier: &endpoint.LbEndpoint_Endpoint{
Endpoint: &endpoint.Endpoint{
Address: &addr,
},
},
LoadBalancingWeight: &types.UInt32Value{
Value: w,
Expand Down
18 changes: 10 additions & 8 deletions pilot/pkg/proxy/envoy/v2/ep_filters_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ func TestEndpointsByNetworkFilter(t *testing.T) {
}

sort.Slice(filtered, func(i, j int) bool {
addrI := filtered[i].LbEndpoints[0].Endpoint.Address.GetSocketAddress().Address
addrJ := filtered[j].LbEndpoints[0].Endpoint.Address.GetSocketAddress().Address
addrI := filtered[i].LbEndpoints[0].GetEndpoint().Address.GetSocketAddress().Address
addrJ := filtered[j].LbEndpoints[0].GetEndpoint().Address.GetSocketAddress().Address
return addrI < addrJ
})

Expand All @@ -159,7 +159,7 @@ func TestEndpointsByNetworkFilter(t *testing.T) {
}

for _, lbEp := range ep.LbEndpoints {
addr := lbEp.Endpoint.Address.GetSocketAddress().Address
addr := lbEp.GetEndpoint().Address.GetSocketAddress().Address
found := false
for _, wantLbEp := range tt.want[i].lbEps {
if addr == wantLbEp.address {
Expand Down Expand Up @@ -262,11 +262,13 @@ func createLbEndpoints(lbEpsInfo []LbEpInfo) []endpoint.LbEndpoint {
lbEndpoints := make([]endpoint.LbEndpoint, len(lbEpsInfo))
for j, lbEpInfo := range lbEpsInfo {
lbEp := endpoint.LbEndpoint{
Endpoint: &endpoint.Endpoint{
Address: &core.Address{
Address: &core.Address_SocketAddress{
SocketAddress: &core.SocketAddress{
Address: lbEpInfo.address,
HostIdentifier: &endpoint.LbEndpoint_Endpoint{
Endpoint: &endpoint.Endpoint{
Address: &core.Address{
Address: &core.Address_SocketAddress{
SocketAddress: &core.SocketAddress{
Address: lbEpInfo.address,
},
},
},
},
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 10 additions & 1 deletion vendor/github.com/envoyproxy/go-control-plane/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/github.com/envoyproxy/go-control-plane/Makefile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/github.com/envoyproxy/go-control-plane/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 82e5848

Please sign in to comment.