Skip to content

Commit

Permalink
Envoy contol-plane API upgrade (istio#15949)
Browse files Browse the repository at this point in the history
* upgrade envoy api

* related fix

* update

* update

* update

* update

* update

* update

* fix

* fix

* fix

* fix

* fix

* fix

* fix
  • Loading branch information
hzxuzhonghu authored and istio-testing committed Jul 31, 2019
1 parent 89cb553 commit 0d11bd2
Show file tree
Hide file tree
Showing 186 changed files with 9,464 additions and 9,001 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ require (
github.com/elazarl/goproxy v0.0.0-20190421051319-9d40249d3c2f // indirect
github.com/elazarl/goproxy/ext v0.0.0-20190421051319-9d40249d3c2f // indirect
github.com/emicklei/go-restful v2.6.0+incompatible
github.com/envoyproxy/go-control-plane v0.8.2
github.com/envoyproxy/go-control-plane v0.8.3
github.com/evanphx/json-patch v3.0.0+incompatible
github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 // indirect
github.com/facebookgo/stackerr v0.0.0-20150612192056-c2fcf88613f4 // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ github.com/emicklei/go-restful v2.6.0+incompatible h1:luAX89wpjId5gV+GJV11MFD56G
github.com/emicklei/go-restful v2.6.0+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs=
github.com/envoyproxy/go-control-plane v0.8.2 h1:HsOE6hYsY5/UYEjZ/rNezsZUBiMxJdBNxgsDQZbxIaU=
github.com/envoyproxy/go-control-plane v0.8.2/go.mod h1:EWRTAFN6uuDZIa6KOuUfrOMJ7ySgXZ44rVKiTWjKe34=
github.com/envoyproxy/go-control-plane v0.8.3 h1:Sqcub1O4SnINoXxNmqbNSeNcZ7O/mkk5jq2Ou6JF7HU=
github.com/envoyproxy/go-control-plane v0.8.3/go.mod h1:EWRTAFN6uuDZIa6KOuUfrOMJ7ySgXZ44rVKiTWjKe34=
github.com/envoyproxy/protoc-gen-validate v0.0.0-20190405222122-d6164de49109 h1:FNgqGzbOm637YKRbYGKb9cqGo8i50++w/LWvMau7jrw=
github.com/envoyproxy/protoc-gen-validate v0.0.0-20190405222122-d6164de49109/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/evanphx/json-patch v3.0.0+incompatible h1:l91aby7TzBXBdmF8heZqjskeH9f3g7ZOL8/sSe+vTlU=
Expand Down
4 changes: 2 additions & 2 deletions istioctl/pkg/auth/listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ type ParsedListener struct {
filterChains []*filterChain
}

func getFilterConfig(filter listener.Filter, out proto.Message) error {
func getFilterConfig(filter *listener.Filter, out proto.Message) error {
switch c := filter.ConfigType.(type) {
case *listener.Filter_Config:
if err := util.StructToMessage(c.Config, out); err != nil {
Expand All @@ -74,7 +74,7 @@ func getFilterConfig(filter listener.Filter, out proto.Message) error {
return nil
}

func getHTTPConnectionManager(filter listener.Filter) *hcm_filter.HttpConnectionManager {
func getHTTPConnectionManager(filter *listener.Filter) *hcm_filter.HttpConnectionManager {
cm := &hcm_filter.HttpConnectionManager{}
if err := getFilterConfig(filter, cm); err != nil {
log.Errorf("failed to get HTTP connection manager config: %s", err)
Expand Down
2 changes: 1 addition & 1 deletion istioctl/pkg/util/configdump/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func (w *Wrapper) GetBootstrapConfigDump() (*adminapi.BootstrapConfigDump, error
}
bootstrapDumpAny := w.Configs[0]
bootstrapDump := &adminapi.BootstrapConfigDump{}
err := proto.UnmarshalAny(&bootstrapDumpAny, bootstrapDump)
err := proto.UnmarshalAny(bootstrapDumpAny, bootstrapDump)
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion istioctl/pkg/util/configdump/bootstrap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func TestWrapper_GetBootstrapConfigDump(t *testing.T) {
t.Run(tt.name, func(t *testing.T) {
w := setupWrapper(t)
if tt.noBootstrap {
w.Configs = []proto.Any{}
w.Configs = []*proto.Any{}
}
if tt.noConfigs {
w.Configs = nil
Expand Down
2 changes: 1 addition & 1 deletion istioctl/pkg/util/configdump/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func (w *Wrapper) GetClusterConfigDump() (*adminapi.ClustersConfigDump, error) {
}
clusterDumpAny := w.Configs[1]
clusterDump := &adminapi.ClustersConfigDump{}
err := proto.UnmarshalAny(&clusterDumpAny, clusterDump)
err := proto.UnmarshalAny(clusterDumpAny, clusterDump)
if err != nil {
return nil, err
}
Expand Down
4 changes: 2 additions & 2 deletions istioctl/pkg/util/configdump/cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func TestWrapper_GetClusterConfigDump(t *testing.T) {
t.Run(tt.name, func(t *testing.T) {
w := setupWrapper(t)
if tt.noCluster {
w.Configs = []proto.Any{}
w.Configs = []*proto.Any{}
}
if tt.noConfigs {
w.Configs = nil
Expand Down Expand Up @@ -120,7 +120,7 @@ func TestWrapper_GetDynamicClusterDump(t *testing.T) {
t.Run(tt.name, func(t *testing.T) {
w := setupWrapper(t)
if tt.noCluster {
w.Configs = []proto.Any{}
w.Configs = []*proto.Any{}
}
got, err := w.GetDynamicClusterDump(tt.stripVersion)
if (err != nil) != tt.wantErr {
Expand Down
2 changes: 1 addition & 1 deletion istioctl/pkg/util/configdump/listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func (w *Wrapper) GetListenerConfigDump() (*adminapi.ListenersConfigDump, error)
}
listenerDumpAny := w.Configs[2]
listenerDump := &adminapi.ListenersConfigDump{}
err := proto.UnmarshalAny(&listenerDumpAny, listenerDump)
err := proto.UnmarshalAny(listenerDumpAny, listenerDump)
if err != nil {
return nil, err
}
Expand Down
4 changes: 2 additions & 2 deletions istioctl/pkg/util/configdump/listener_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func TestWrapper_GetListenerConfigDump(t *testing.T) {
t.Run(tt.name, func(t *testing.T) {
w := setupWrapper(t)
if tt.noListener {
w.Configs = []proto.Any{}
w.Configs = []*proto.Any{}
}
if tt.noConfigs {
w.Configs = nil
Expand Down Expand Up @@ -110,7 +110,7 @@ func TestWrapper_GetDynamicListenerDump(t *testing.T) {
t.Run(tt.name, func(t *testing.T) {
w := setupWrapper(t)
if tt.noListener {
w.Configs = []proto.Any{}
w.Configs = []*proto.Any{}
}
got, err := w.GetDynamicListenerDump(tt.stripVersion)
if (err != nil) != tt.wantErr {
Expand Down
2 changes: 1 addition & 1 deletion istioctl/pkg/util/configdump/route.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func (w *Wrapper) GetRouteConfigDump() (*adminapi.RoutesConfigDump, error) {
var routeDumpAny proto.Any
for _, conf := range w.Configs {
if conf.TypeUrl == "type.googleapis.com/envoy.admin.v2alpha.RoutesConfigDump" {
routeDumpAny = conf
routeDumpAny = *conf
}
}
if routeDumpAny.TypeUrl == "" {
Expand Down
4 changes: 2 additions & 2 deletions istioctl/pkg/util/configdump/route_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func TestWrapper_GetRouteConfigDump(t *testing.T) {
t.Run(tt.name, func(t *testing.T) {
w := setupWrapper(t)
if tt.noRoute {
w.Configs = []proto.Any{}
w.Configs = []*proto.Any{}
}
if tt.noConfigs {
w.Configs = nil
Expand Down Expand Up @@ -105,7 +105,7 @@ func TestWrapper_GetDynamicRouteDump(t *testing.T) {
t.Run(tt.name, func(t *testing.T) {
w := setupWrapper(t)
if tt.noRoute {
w.Configs = []proto.Any{}
w.Configs = []*proto.Any{}
}
got, err := w.GetDynamicRouteDump(tt.stripVersion)
if (err != nil) != tt.wantErr {
Expand Down
4 changes: 2 additions & 2 deletions mixer/test/client/dynamic_attribute/dynamic_attribute_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,8 @@ func TestDynamicAttribute(t *testing.T) {
Endpoints: cache.Resources{Version: "1", Items: map[string]cache.Resource{
"backend": &v2.ClusterLoadAssignment{
ClusterName: "backend",
Endpoints: []endpoint.LocalityLbEndpoints{{
LbEndpoints: []endpoint.LbEndpoint{{
Endpoints: []*endpoint.LocalityLbEndpoints{{
LbEndpoints: []*endpoint.LbEndpoint{{
Metadata: &core.Metadata{
FilterMetadata: map[string]*types.Struct{
"istio": {
Expand Down
12 changes: 6 additions & 6 deletions mixer/test/client/dynamic_listener/dynamic_listener_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,11 @@ func makeListener(s *env.TestSetup, key string) *v2.Listener {
RouteSpecifier: &hcm.HttpConnectionManager_RouteConfig{
RouteConfig: &v2.RouteConfiguration{
Name: key,
VirtualHosts: []route.VirtualHost{{
VirtualHosts: []*route.VirtualHost{{
Name: "backend",
Domains: []string{"*"},
Routes: []route.Route{{
Match: route.RouteMatch{PathSpecifier: &route.RouteMatch_Prefix{Prefix: "/"}},
Routes: []*route.Route{{
Match: &route.RouteMatch{PathSpecifier: &route.RouteMatch_Prefix{Prefix: "/"}},
Action: &route.Route_Route{Route: &route.RouteAction{
ClusterSpecifier: &route.RouteAction_Cluster{Cluster: "backend"},
}},
Expand All @@ -166,11 +166,11 @@ func makeListener(s *env.TestSetup, key string) *v2.Listener {

return &v2.Listener{
Name: strconv.Itoa(int(s.Ports().ServerProxyPort)),
Address: core.Address{Address: &core.Address_SocketAddress{SocketAddress: &core.SocketAddress{
Address: &core.Address{Address: &core.Address_SocketAddress{SocketAddress: &core.SocketAddress{
Address: "127.0.0.1",
PortSpecifier: &core.SocketAddress_PortValue{PortValue: uint32(s.Ports().ServerProxyPort)}}}},
FilterChains: []listener.FilterChain{{
Filters: []listener.Filter{{
FilterChains: []*listener.FilterChain{{
Filters: []*listener.Filter{{
Name: util.HTTPConnectionManager,
ConfigType: &listener.Filter_Config{pbst},
}},
Expand Down
12 changes: 6 additions & 6 deletions mixer/test/client/gateway/gateway_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,11 +287,11 @@ var (
func makeRoute(cluster string) *v2.RouteConfiguration {
return &v2.RouteConfiguration{
Name: cluster,
VirtualHosts: []route.VirtualHost{{
VirtualHosts: []*route.VirtualHost{{
Name: cluster,
Domains: []string{"*"},
Routes: []route.Route{{
Match: route.RouteMatch{PathSpecifier: &route.RouteMatch_Prefix{Prefix: "/"}},
Routes: []*route.Route{{
Match: &route.RouteMatch{PathSpecifier: &route.RouteMatch_Prefix{Prefix: "/"}},
Action: &route.Route_Route{Route: &route.RouteAction{
ClusterSpecifier: &route.RouteAction_Cluster{Cluster: cluster},
}},
Expand All @@ -303,14 +303,14 @@ func makeRoute(cluster string) *v2.RouteConfiguration {
func makeListener(port uint16, route string) (*v2.Listener, *hcm.HttpConnectionManager) {
return &v2.Listener{
Name: route,
Address: core.Address{Address: &core.Address_SocketAddress{SocketAddress: &core.SocketAddress{
Address: &core.Address{Address: &core.Address_SocketAddress{SocketAddress: &core.SocketAddress{
Address: "127.0.0.1",
PortSpecifier: &core.SocketAddress_PortValue{PortValue: uint32(port)}}}},
}, &hcm.HttpConnectionManager{
CodecType: hcm.AUTO,
StatPrefix: route,
RouteSpecifier: &hcm.HttpConnectionManager_Rds{
Rds: &hcm.Rds{RouteConfigName: route, ConfigSource: core.ConfigSource{
Rds: &hcm.Rds{RouteConfigName: route, ConfigSource: &core.ConfigSource{
ConfigSourceSpecifier: &core.ConfigSource_Ads{Ads: &core.AggregatedConfigSource{}},
}},
},
Expand All @@ -329,7 +329,7 @@ func makeSnapshot(s *env.TestSetup, t *testing.T) cache.Snapshot {
t.Error(err)
}
clientManager.HttpFilters = append(clientMutable.FilterChains[0].HTTP, clientManager.HttpFilters...)
clientListener.FilterChains = []listener.FilterChain{{Filters: []listener.Filter{{
clientListener.FilterChains = []*listener.FilterChain{{Filters: []*listener.Filter{{
Name: util.HTTPConnectionManager,
ConfigType: &listener.Filter_TypedConfig{TypedConfig: pilotutil.MessageToAny(clientManager)},
}}}}
Expand Down
14 changes: 7 additions & 7 deletions mixer/test/client/pilotplugin/pilotplugin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -364,11 +364,11 @@ var (
func makeRoute(cluster string) *v2.RouteConfiguration {
return &v2.RouteConfiguration{
Name: cluster,
VirtualHosts: []route.VirtualHost{{
VirtualHosts: []*route.VirtualHost{{
Name: cluster,
Domains: []string{"*"},
Routes: []route.Route{{
Match: route.RouteMatch{PathSpecifier: &route.RouteMatch_Prefix{Prefix: "/"}},
Routes: []*route.Route{{
Match: &route.RouteMatch{PathSpecifier: &route.RouteMatch_Prefix{Prefix: "/"}},
Action: &route.Route_Route{Route: &route.RouteAction{
ClusterSpecifier: &route.RouteAction_Cluster{Cluster: cluster},
}},
Expand All @@ -380,14 +380,14 @@ func makeRoute(cluster string) *v2.RouteConfiguration {
func makeListener(port uint16, route string) (*v2.Listener, *hcm.HttpConnectionManager) {
return &v2.Listener{
Name: route,
Address: core.Address{Address: &core.Address_SocketAddress{SocketAddress: &core.SocketAddress{
Address: &core.Address{Address: &core.Address_SocketAddress{SocketAddress: &core.SocketAddress{
Address: "127.0.0.1",
PortSpecifier: &core.SocketAddress_PortValue{PortValue: uint32(port)}}}},
}, &hcm.HttpConnectionManager{
CodecType: hcm.AUTO,
StatPrefix: route,
RouteSpecifier: &hcm.HttpConnectionManager_Rds{
Rds: &hcm.Rds{RouteConfigName: route, ConfigSource: core.ConfigSource{
Rds: &hcm.Rds{RouteConfigName: route, ConfigSource: &core.ConfigSource{
ConfigSourceSpecifier: &core.ConfigSource_Ads{Ads: &core.AggregatedConfigSource{}},
}},
},
Expand All @@ -408,7 +408,7 @@ func makeSnapshot(s *env.TestSetup, t *testing.T) cache.Snapshot {
t.Error(err)
}
serverManager.HttpFilters = append(serverMutable.FilterChains[0].HTTP, serverManager.HttpFilters...)
serverListener.FilterChains = []listener.FilterChain{{Filters: []listener.Filter{{
serverListener.FilterChains = []*listener.FilterChain{{Filters: []*listener.Filter{{
Name: util.HTTPConnectionManager,
ConfigType: &listener.Filter_TypedConfig{TypedConfig: pilotutil.MessageToAny(serverManager)},
}}}}
Expand All @@ -418,7 +418,7 @@ func makeSnapshot(s *env.TestSetup, t *testing.T) cache.Snapshot {
t.Error(err)
}
clientManager.HttpFilters = append(clientMutable.FilterChains[0].HTTP, clientManager.HttpFilters...)
clientListener.FilterChains = []listener.FilterChain{{Filters: []listener.Filter{{
clientListener.FilterChains = []*listener.FilterChain{{Filters: []*listener.Filter{{
Name: util.HTTPConnectionManager,
ConfigType: &listener.Filter_TypedConfig{TypedConfig: pilotutil.MessageToAny(clientManager)},
}}}}
Expand Down
18 changes: 9 additions & 9 deletions mixer/test/client/pilotplugin_mtls/pilotplugin_mtls_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -379,11 +379,11 @@ var (
func makeRoute(cluster string) *v2.RouteConfiguration {
return &v2.RouteConfiguration{
Name: cluster,
VirtualHosts: []route.VirtualHost{{
VirtualHosts: []*route.VirtualHost{{
Name: cluster,
Domains: []string{"*"},
Routes: []route.Route{{
Match: route.RouteMatch{PathSpecifier: &route.RouteMatch_Prefix{Prefix: "/"}},
Routes: []*route.Route{{
Match: &route.RouteMatch{PathSpecifier: &route.RouteMatch_Prefix{Prefix: "/"}},
Action: &route.Route_Route{Route: &route.RouteAction{
ClusterSpecifier: &route.RouteAction_Cluster{Cluster: cluster},
}},
Expand All @@ -395,17 +395,17 @@ func makeRoute(cluster string) *v2.RouteConfiguration {
func makeListener(port uint16, route string) (*v2.Listener, *hcm.HttpConnectionManager) {
return &v2.Listener{
Name: route,
Address: core.Address{Address: &core.Address_SocketAddress{SocketAddress: &core.SocketAddress{
Address: &core.Address{Address: &core.Address_SocketAddress{SocketAddress: &core.SocketAddress{
Address: "127.0.0.1",
PortSpecifier: &core.SocketAddress_PortValue{PortValue: uint32(port)}}}},
ListenerFilters: []listener.ListenerFilter{{
ListenerFilters: []*listener.ListenerFilter{{
Name: "envoy.listener.tls_inspector",
}},
}, &hcm.HttpConnectionManager{
CodecType: hcm.AUTO,
StatPrefix: route,
RouteSpecifier: &hcm.HttpConnectionManager_Rds{
Rds: &hcm.Rds{RouteConfigName: route, ConfigSource: core.ConfigSource{
Rds: &hcm.Rds{RouteConfigName: route, ConfigSource: &core.ConfigSource{
ConfigSourceSpecifier: &core.ConfigSource_Ads{Ads: &core.AggregatedConfigSource{}},
}},
},
Expand All @@ -426,8 +426,8 @@ func makeSnapshot(s *env.TestSetup, t *testing.T) cache.Snapshot {
t.Error(err)
}
serverManager.HttpFilters = append(serverMutable.FilterChains[0].HTTP, serverManager.HttpFilters...)
serverListener.FilterChains = []listener.FilterChain{{
Filters: []listener.Filter{{
serverListener.FilterChains = []*listener.FilterChain{{
Filters: []*listener.Filter{{
Name: util.HTTPConnectionManager,
ConfigType: &listener.Filter_TypedConfig{TypedConfig: pilotutil.MessageToAny(serverManager)},
}},
Expand All @@ -453,7 +453,7 @@ func makeSnapshot(s *env.TestSetup, t *testing.T) cache.Snapshot {
t.Error(err)
}
clientManager.HttpFilters = append(clientMutable.FilterChains[0].HTTP, clientManager.HttpFilters...)
clientListener.FilterChains = []listener.FilterChain{{Filters: []listener.Filter{{
clientListener.FilterChains = []*listener.FilterChain{{Filters: []*listener.Filter{{
Name: util.HTTPConnectionManager,
ConfigType: &listener.Filter_TypedConfig{TypedConfig: pilotutil.MessageToAny(clientManager)},
}}}}
Expand Down
4 changes: 2 additions & 2 deletions mixer/test/client/pilotplugin_tcp/pilotplugin_tcp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,10 +226,10 @@ var (
func makeListener(port uint16, cluster string) *v2.Listener {
return &v2.Listener{
Name: cluster,
Address: core.Address{Address: &core.Address_SocketAddress{SocketAddress: &core.SocketAddress{
Address: &core.Address{Address: &core.Address_SocketAddress{SocketAddress: &core.SocketAddress{
Address: "127.0.0.1",
PortSpecifier: &core.SocketAddress_PortValue{PortValue: uint32(port)}}}},
FilterChains: []listener.FilterChain{{Filters: []listener.Filter{{
FilterChains: []*listener.FilterChain{{Filters: []*listener.Filter{{
Name: util.TCPProxy,
ConfigType: &listener.Filter_TypedConfig{
TypedConfig: pilotutil.MessageToAny(&tcp_proxy.TcpProxy{
Expand Down
Loading

0 comments on commit 0d11bd2

Please sign in to comment.