From da6237c0d23045593ac09e1e2ff17c988484e603 Mon Sep 17 00:00:00 2001 From: Easwar Swaminathan Date: Fri, 2 Aug 2019 13:43:14 -0700 Subject: [PATCH] Move code out of balancer/xds. We will have a root level xds/ directory which will eventually contain all xDS implementation including balancer, resolver, client etc. The new structure looks something like this: grpc/ | +--xds/ | +--internal/ | | | +--balancer/ | | | +--edsbalancer/ | | | +--lrs/ | | | +--orca/ | +--experimental/ Users need to import grpc/xds/experimental package to get all xds functionality, and this will eventually be moved to grpc/xds. Also, moved grpc/balancer/internal/wrr to grpc/internal/wrr. --- {balancer/internal => internal}/wrr/random.go | 0 {balancer/internal => internal}/wrr/wrr.go | 0 .../internal => internal}/wrr/wrr_test.go | 0 vet.sh | 6 ++-- xds/experimental/xds_experimental.go | 32 +++++++++++++++++++ .../balancer}/edsbalancer/balancergroup.go | 8 ++--- .../edsbalancer/balancergroup_test.go | 4 +-- .../balancer}/edsbalancer/edsbalancer.go | 10 +++--- .../balancer}/edsbalancer/edsbalancer_test.go | 12 +++---- .../balancer}/edsbalancer/test_util_test.go | 2 +- .../internal/balancer}/edsbalancer/util.go | 2 +- .../balancer}/edsbalancer/util_test.go | 2 +- .../xds => xds/internal/balancer}/lrs/lrs.go | 10 +++--- .../internal/balancer}/lrs/lrs_test.go | 10 +++--- .../internal/balancer}/orca/orca.go | 2 +- .../internal/balancer}/orca/orca_test.go | 2 +- .../xds => xds/internal/balancer}/xds.go | 21 ++++++------ .../internal/balancer}/xds_client.go | 16 +++++----- .../internal/balancer}/xds_client_test.go | 20 ++++++------ .../internal/balancer}/xds_lrs_test.go | 10 +++--- .../xds => xds/internal/balancer}/xds_test.go | 9 +++--- {balancer/xds => xds}/internal/const.go | 0 {balancer/xds => xds}/internal/internal.go | 2 +- .../xds => xds}/internal/internal_test.go | 2 +- .../proto/envoy/api/v2/auth/cert/cert.pb.go | 6 ++-- .../internal/proto/envoy/api/v2/cds/cds.pb.go | 24 +++++++------- .../circuit_breaker/circuit_breaker.pb.go | 2 +- .../outlier_detection/outlier_detection.pb.go | 2 +- .../envoy/api/v2/core/address/address.pb.go | 4 +-- .../proto/envoy/api/v2/core/base/base.pb.go | 6 ++-- .../v2/core/config_source/config_source.pb.go | 4 +-- .../v2/core/grpc_service/grpc_service.pb.go | 4 +-- .../v2/core/health_check/health_check.pb.go | 6 ++-- .../envoy/api/v2/core/protocol/protocol.pb.go | 2 +- .../envoy/api/v2/discovery/discovery.pb.go | 2 +- .../internal/proto/envoy/api/v2/eds/eds.pb.go | 8 ++--- .../api/v2/endpoint/endpoint/endpoint.pb.go | 8 ++--- .../v2/endpoint/load_report/load_report.pb.go | 6 ++-- .../envoy/service/discovery/v2/ads/ads.pb.go | 2 +- .../envoy/service/load_stats/v2/lrs/lrs.pb.go | 6 ++-- .../proto/envoy/type/percent/percent.pb.go | 2 +- .../proto/envoy/type/range/range.pb.go | 0 .../orca_load_report/orca_load_report.pb.go | 2 +- .../udpa/service/orca/v1/orca/orca.pb.go | 4 +-- .../internal/proto/validate/validate.pb.go | 2 +- .../internal/regenerate_scripts/README.md | 2 +- .../regenerate_scripts/envoy-proto-gen.sh | 2 +- .../regenerate_scripts/utils/README.md | 0 .../regenerate_scripts/utils/WORKSPACE | 0 .../regenerate_scripts/utils/cleanup.sh | 0 .../utils/data-plane-api.patch | 2 +- .../regenerate_scripts/utils/proto-gen.sh | 0 .../utils/protoc-gen-validate.patch | 4 +-- 53 files changed, 162 insertions(+), 132 deletions(-) rename {balancer/internal => internal}/wrr/random.go (100%) rename {balancer/internal => internal}/wrr/wrr.go (100%) rename {balancer/internal => internal}/wrr/wrr_test.go (100%) create mode 100644 xds/experimental/xds_experimental.go rename {balancer/xds => xds/internal/balancer}/edsbalancer/balancergroup.go (98%) rename {balancer/xds => xds/internal/balancer}/edsbalancer/balancergroup_test.go (99%) rename {balancer/xds => xds/internal/balancer}/edsbalancer/edsbalancer.go (96%) rename {balancer/xds => xds/internal/balancer}/edsbalancer/edsbalancer_test.go (97%) rename {balancer/xds => xds/internal/balancer}/edsbalancer/test_util_test.go (99%) rename {balancer/xds => xds/internal/balancer}/edsbalancer/util.go (95%) rename {balancer/xds => xds/internal/balancer}/edsbalancer/util_test.go (98%) rename {balancer/xds => xds/internal/balancer}/lrs/lrs.go (96%) rename {balancer/xds => xds/internal/balancer}/lrs/lrs_test.go (97%) rename {balancer/xds => xds/internal/balancer}/orca/orca.go (95%) rename {balancer/xds => xds/internal/balancer}/orca/orca_test.go (95%) rename {balancer/xds => xds/internal/balancer}/xds.go (97%) rename {balancer/xds => xds/internal/balancer}/xds_client.go (93%) rename {balancer/xds => xds/internal/balancer}/xds_client_test.go (94%) rename {balancer/xds => xds/internal/balancer}/xds_lrs_test.go (92%) rename {balancer/xds => xds/internal/balancer}/xds_test.go (98%) rename {balancer/xds => xds}/internal/const.go (100%) rename {balancer/xds => xds}/internal/internal.go (93%) rename {balancer/xds => xds}/internal/internal_test.go (95%) rename {balancer/xds => xds}/internal/proto/envoy/api/v2/auth/cert/cert.pb.go (99%) rename {balancer/xds => xds}/internal/proto/envoy/api/v2/cds/cds.pb.go (98%) rename {balancer/xds => xds}/internal/proto/envoy/api/v2/cluster/circuit_breaker/circuit_breaker.pb.go (98%) rename {balancer/xds => xds}/internal/proto/envoy/api/v2/cluster/outlier_detection/outlier_detection.pb.go (99%) rename {balancer/xds => xds}/internal/proto/envoy/api/v2/core/address/address.pb.go (99%) rename {balancer/xds => xds}/internal/proto/envoy/api/v2/core/base/base.pb.go (99%) rename {balancer/xds => xds}/internal/proto/envoy/api/v2/core/config_source/config_source.pb.go (99%) rename {balancer/xds => xds}/internal/proto/envoy/api/v2/core/grpc_service/grpc_service.pb.go (99%) rename {balancer/xds => xds}/internal/proto/envoy/api/v2/core/health_check/health_check.pb.go (99%) rename {balancer/xds => xds}/internal/proto/envoy/api/v2/core/protocol/protocol.pb.go (99%) rename {balancer/xds => xds}/internal/proto/envoy/api/v2/discovery/discovery.pb.go (99%) rename {balancer/xds => xds}/internal/proto/envoy/api/v2/eds/eds.pb.go (98%) rename {balancer/xds => xds}/internal/proto/envoy/api/v2/endpoint/endpoint/endpoint.pb.go (97%) rename {balancer/xds => xds}/internal/proto/envoy/api/v2/endpoint/load_report/load_report.pb.go (98%) rename {balancer/xds => xds}/internal/proto/envoy/service/discovery/v2/ads/ads.pb.go (99%) rename {balancer/xds => xds}/internal/proto/envoy/service/load_stats/v2/lrs/lrs.pb.go (97%) rename {balancer/xds => xds}/internal/proto/envoy/type/percent/percent.pb.go (98%) rename {balancer/xds => xds}/internal/proto/envoy/type/range/range.pb.go (100%) rename {balancer/xds => xds}/internal/proto/udpa/data/orca/v1/orca_load_report/orca_load_report.pb.go (98%) rename {balancer/xds => xds}/internal/proto/udpa/service/orca/v1/orca/orca.pb.go (97%) rename {balancer/xds => xds}/internal/proto/validate/validate.pb.go (99%) rename {balancer/xds => xds}/internal/regenerate_scripts/README.md (93%) rename {balancer/xds => xds}/internal/regenerate_scripts/envoy-proto-gen.sh (93%) rename {balancer/xds => xds}/internal/regenerate_scripts/utils/README.md (100%) rename {balancer/xds => xds}/internal/regenerate_scripts/utils/WORKSPACE (100%) rename {balancer/xds => xds}/internal/regenerate_scripts/utils/cleanup.sh (100%) rename {balancer/xds => xds}/internal/regenerate_scripts/utils/data-plane-api.patch (94%) rename {balancer/xds => xds}/internal/regenerate_scripts/utils/proto-gen.sh (100%) rename {balancer/xds => xds}/internal/regenerate_scripts/utils/protoc-gen-validate.patch (81%) diff --git a/balancer/internal/wrr/random.go b/internal/wrr/random.go similarity index 100% rename from balancer/internal/wrr/random.go rename to internal/wrr/random.go diff --git a/balancer/internal/wrr/wrr.go b/internal/wrr/wrr.go similarity index 100% rename from balancer/internal/wrr/wrr.go rename to internal/wrr/wrr.go diff --git a/balancer/internal/wrr/wrr_test.go b/internal/wrr/wrr_test.go similarity index 100% rename from balancer/internal/wrr/wrr_test.go rename to internal/wrr/wrr_test.go diff --git a/vet.sh b/vet.sh index 4467bd6cc7ee..661e1e1de9b6 100755 --- a/vet.sh +++ b/vet.sh @@ -110,9 +110,9 @@ staticcheck -go 1.9 -checks 'inherit,-ST1015' -ignore ' google.golang.org/grpc/balancer.go:SA1019 google.golang.org/grpc/balancer/grpclb/grpclb_remote_balancer.go:SA1019 google.golang.org/grpc/balancer/roundrobin/roundrobin_test.go:SA1019 -google.golang.org/grpc/balancer/xds/edsbalancer/balancergroup.go:SA1019 -google.golang.org/grpc/balancer/xds/xds.go:SA1019 -google.golang.org/grpc/balancer/xds/xds_client.go:SA1019 +google.golang.org/grpc/xds/internal/balancer/edsbalancer/balancergroup.go:SA1019 +google.golang.org/grpc/xds/internal/balancer/xds.go:SA1019 +google.golang.org/grpc/xds/internal/balancer/xds_client.go:SA1019 google.golang.org/grpc/balancer_conn_wrappers.go:SA1019 google.golang.org/grpc/balancer_test.go:SA1019 google.golang.org/grpc/benchmark/benchmain/main.go:SA1019 diff --git a/xds/experimental/xds_experimental.go b/xds/experimental/xds_experimental.go new file mode 100644 index 000000000000..7477ea3d94c5 --- /dev/null +++ b/xds/experimental/xds_experimental.go @@ -0,0 +1,32 @@ +/* + * + * Copyright 2019 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Package experimental contains xds implementation, still in experimental +// state. Users only need to import this package to get all xds functionality. +// Things are expected to change fast until we get to a stable state, at +// which point, all this will be moved to the xds package. +package experimental + +import ( + "google.golang.org/grpc/balancer" + xdsbalancer "google.golang.org/grpc/xds/internal/balancer" +) + +func init() { + balancer.Register(xdsbalancer.NewBalancerBuilder()) +} diff --git a/balancer/xds/edsbalancer/balancergroup.go b/xds/internal/balancer/edsbalancer/balancergroup.go similarity index 98% rename from balancer/xds/edsbalancer/balancergroup.go rename to xds/internal/balancer/edsbalancer/balancergroup.go index 9e8a5254f4c3..5b1392eca51d 100644 --- a/balancer/xds/edsbalancer/balancergroup.go +++ b/xds/internal/balancer/edsbalancer/balancergroup.go @@ -22,13 +22,13 @@ import ( "google.golang.org/grpc/balancer" "google.golang.org/grpc/balancer/base" - "google.golang.org/grpc/balancer/internal/wrr" - "google.golang.org/grpc/balancer/xds/internal" - orcapb "google.golang.org/grpc/balancer/xds/internal/proto/udpa/data/orca/v1/orca_load_report" - "google.golang.org/grpc/balancer/xds/lrs" "google.golang.org/grpc/connectivity" "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/internal/wrr" "google.golang.org/grpc/resolver" + "google.golang.org/grpc/xds/internal" + "google.golang.org/grpc/xds/internal/balancer/lrs" + orcapb "google.golang.org/grpc/xds/internal/proto/udpa/data/orca/v1/orca_load_report" ) type pickerState struct { diff --git a/balancer/xds/edsbalancer/balancergroup_test.go b/xds/internal/balancer/edsbalancer/balancergroup_test.go similarity index 99% rename from balancer/xds/edsbalancer/balancergroup_test.go rename to xds/internal/balancer/edsbalancer/balancergroup_test.go index bec8066dae95..748eb0b64a42 100644 --- a/balancer/xds/edsbalancer/balancergroup_test.go +++ b/xds/internal/balancer/edsbalancer/balancergroup_test.go @@ -23,10 +23,10 @@ import ( "google.golang.org/grpc/balancer" "google.golang.org/grpc/balancer/roundrobin" - "google.golang.org/grpc/balancer/xds/internal" - orcapb "google.golang.org/grpc/balancer/xds/internal/proto/udpa/data/orca/v1/orca_load_report" "google.golang.org/grpc/connectivity" "google.golang.org/grpc/resolver" + "google.golang.org/grpc/xds/internal" + orcapb "google.golang.org/grpc/xds/internal/proto/udpa/data/orca/v1/orca_load_report" ) var ( diff --git a/balancer/xds/edsbalancer/edsbalancer.go b/xds/internal/balancer/edsbalancer/edsbalancer.go similarity index 96% rename from balancer/xds/edsbalancer/edsbalancer.go rename to xds/internal/balancer/edsbalancer/edsbalancer.go index 7ffa21ec9b3e..1145d3fbdfa3 100644 --- a/balancer/xds/edsbalancer/edsbalancer.go +++ b/xds/internal/balancer/edsbalancer/edsbalancer.go @@ -27,16 +27,16 @@ import ( "google.golang.org/grpc/balancer" "google.golang.org/grpc/balancer/roundrobin" - "google.golang.org/grpc/balancer/xds/internal" - edspb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/eds" - endpointpb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/endpoint/endpoint" - percentpb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/type/percent" - "google.golang.org/grpc/balancer/xds/lrs" "google.golang.org/grpc/codes" "google.golang.org/grpc/connectivity" "google.golang.org/grpc/grpclog" "google.golang.org/grpc/resolver" "google.golang.org/grpc/status" + "google.golang.org/grpc/xds/internal" + "google.golang.org/grpc/xds/internal/balancer/lrs" + edspb "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/eds" + endpointpb "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/endpoint/endpoint" + percentpb "google.golang.org/grpc/xds/internal/proto/envoy/type/percent" ) type localityConfig struct { diff --git a/balancer/xds/edsbalancer/edsbalancer_test.go b/xds/internal/balancer/edsbalancer/edsbalancer_test.go similarity index 97% rename from balancer/xds/edsbalancer/edsbalancer_test.go rename to xds/internal/balancer/edsbalancer/edsbalancer_test.go index 788ccb293787..347fe6d7e007 100644 --- a/balancer/xds/edsbalancer/edsbalancer_test.go +++ b/xds/internal/balancer/edsbalancer/edsbalancer_test.go @@ -27,14 +27,14 @@ import ( typespb "github.com/golang/protobuf/ptypes/wrappers" "google.golang.org/grpc/balancer" "google.golang.org/grpc/balancer/roundrobin" - "google.golang.org/grpc/balancer/xds/internal" - addresspb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/core/address" - basepb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/core/base" - edspb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/eds" - endpointpb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/endpoint/endpoint" - percentpb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/type/percent" "google.golang.org/grpc/connectivity" "google.golang.org/grpc/resolver" + "google.golang.org/grpc/xds/internal" + addresspb "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/core/address" + basepb "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/core/base" + edspb "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/eds" + endpointpb "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/endpoint/endpoint" + percentpb "google.golang.org/grpc/xds/internal/proto/envoy/type/percent" ) var ( diff --git a/balancer/xds/edsbalancer/test_util_test.go b/xds/internal/balancer/edsbalancer/test_util_test.go similarity index 99% rename from balancer/xds/edsbalancer/test_util_test.go rename to xds/internal/balancer/edsbalancer/test_util_test.go index 794848931119..86c7dfb7965a 100644 --- a/balancer/xds/edsbalancer/test_util_test.go +++ b/xds/internal/balancer/edsbalancer/test_util_test.go @@ -23,9 +23,9 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/balancer" - "google.golang.org/grpc/balancer/xds/internal" "google.golang.org/grpc/connectivity" "google.golang.org/grpc/resolver" + "google.golang.org/grpc/xds/internal" ) var ( diff --git a/balancer/xds/edsbalancer/util.go b/xds/internal/balancer/edsbalancer/util.go similarity index 95% rename from balancer/xds/edsbalancer/util.go rename to xds/internal/balancer/edsbalancer/util.go index 5b7ba4b185e2..941b09805c84 100644 --- a/balancer/xds/edsbalancer/util.go +++ b/xds/internal/balancer/edsbalancer/util.go @@ -16,7 +16,7 @@ package edsbalancer -import "google.golang.org/grpc/balancer/internal/wrr" +import "google.golang.org/grpc/internal/wrr" type dropper struct { // Drop rate will be numerator/denominator. diff --git a/balancer/xds/edsbalancer/util_test.go b/xds/internal/balancer/edsbalancer/util_test.go similarity index 98% rename from balancer/xds/edsbalancer/util_test.go rename to xds/internal/balancer/edsbalancer/util_test.go index fe4da770780a..e9d8c73a1333 100644 --- a/balancer/xds/edsbalancer/util_test.go +++ b/xds/internal/balancer/edsbalancer/util_test.go @@ -20,7 +20,7 @@ import ( "sync" "testing" - "google.golang.org/grpc/balancer/internal/wrr" + "google.golang.org/grpc/internal/wrr" ) // testWRR is a deterministic WRR implementation. diff --git a/balancer/xds/lrs/lrs.go b/xds/internal/balancer/lrs/lrs.go similarity index 96% rename from balancer/xds/lrs/lrs.go rename to xds/internal/balancer/lrs/lrs.go index 5b0ab562c651..4b7046155578 100644 --- a/balancer/xds/lrs/lrs.go +++ b/xds/internal/balancer/lrs/lrs.go @@ -26,13 +26,13 @@ import ( "github.com/golang/protobuf/ptypes" structpb "github.com/golang/protobuf/ptypes/struct" "google.golang.org/grpc" - "google.golang.org/grpc/balancer/xds/internal" - basepb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/core/base" - loadreportpb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/endpoint/load_report" - lrsgrpc "google.golang.org/grpc/balancer/xds/internal/proto/envoy/service/load_stats/v2/lrs" - lrspb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/service/load_stats/v2/lrs" "google.golang.org/grpc/grpclog" "google.golang.org/grpc/internal/backoff" + "google.golang.org/grpc/xds/internal" + basepb "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/core/base" + loadreportpb "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/endpoint/load_report" + lrsgrpc "google.golang.org/grpc/xds/internal/proto/envoy/service/load_stats/v2/lrs" + lrspb "google.golang.org/grpc/xds/internal/proto/envoy/service/load_stats/v2/lrs" ) const negativeOneUInt64 = ^uint64(0) diff --git a/balancer/xds/lrs/lrs_test.go b/xds/internal/balancer/lrs/lrs_test.go similarity index 97% rename from balancer/xds/lrs/lrs_test.go rename to xds/internal/balancer/lrs/lrs_test.go index 1dbafd8b021c..8d145d4eb5d6 100644 --- a/balancer/xds/lrs/lrs_test.go +++ b/xds/internal/balancer/lrs/lrs_test.go @@ -33,13 +33,13 @@ import ( structpb "github.com/golang/protobuf/ptypes/struct" "github.com/google/go-cmp/cmp" "google.golang.org/grpc" - "google.golang.org/grpc/balancer/xds/internal" - basepb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/core/base" - loadreportpb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/endpoint/load_report" - lrsgrpc "google.golang.org/grpc/balancer/xds/internal/proto/envoy/service/load_stats/v2/lrs" - lrspb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/service/load_stats/v2/lrs" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + "google.golang.org/grpc/xds/internal" + basepb "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/core/base" + loadreportpb "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/endpoint/load_report" + lrsgrpc "google.golang.org/grpc/xds/internal/proto/envoy/service/load_stats/v2/lrs" + lrspb "google.golang.org/grpc/xds/internal/proto/envoy/service/load_stats/v2/lrs" ) const testService = "grpc.service.test" diff --git a/balancer/xds/orca/orca.go b/xds/internal/balancer/orca/orca.go similarity index 95% rename from balancer/xds/orca/orca.go rename to xds/internal/balancer/orca/orca.go index 864c39fa17a3..b03dc24f8115 100644 --- a/balancer/xds/orca/orca.go +++ b/xds/internal/balancer/orca/orca.go @@ -19,10 +19,10 @@ package orca import ( "github.com/golang/protobuf/proto" - orcapb "google.golang.org/grpc/balancer/xds/internal/proto/udpa/data/orca/v1/orca_load_report" "google.golang.org/grpc/grpclog" "google.golang.org/grpc/internal/balancerload" "google.golang.org/grpc/metadata" + orcapb "google.golang.org/grpc/xds/internal/proto/udpa/data/orca/v1/orca_load_report" ) const mdKey = "X-Endpoint-Load-Metrics-Bin" diff --git a/balancer/xds/orca/orca_test.go b/xds/internal/balancer/orca/orca_test.go similarity index 95% rename from balancer/xds/orca/orca_test.go rename to xds/internal/balancer/orca/orca_test.go index daef792dc1b6..6c199e86d5be 100644 --- a/balancer/xds/orca/orca_test.go +++ b/xds/internal/balancer/orca/orca_test.go @@ -22,8 +22,8 @@ import ( "testing" "github.com/golang/protobuf/proto" - orcapb "google.golang.org/grpc/balancer/xds/internal/proto/udpa/data/orca/v1/orca_load_report" "google.golang.org/grpc/metadata" + orcapb "google.golang.org/grpc/xds/internal/proto/udpa/data/orca/v1/orca_load_report" ) var ( diff --git a/balancer/xds/xds.go b/xds/internal/balancer/xds.go similarity index 97% rename from balancer/xds/xds.go rename to xds/internal/balancer/xds.go index 9993f252809b..4da30ae0025c 100644 --- a/balancer/xds/xds.go +++ b/xds/internal/balancer/xds.go @@ -16,9 +16,8 @@ * */ -// Package xds implements a balancer that communicates with a remote balancer using the Envoy xDS -// protocol. -package xds +// Package balancer contains xds balancer implementation. +package balancer import ( "context" @@ -30,14 +29,14 @@ import ( "github.com/golang/protobuf/proto" "google.golang.org/grpc/balancer" - "google.golang.org/grpc/balancer/xds/edsbalancer" - cdspb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/cds" - edspb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/eds" - "google.golang.org/grpc/balancer/xds/lrs" "google.golang.org/grpc/connectivity" "google.golang.org/grpc/grpclog" "google.golang.org/grpc/resolver" "google.golang.org/grpc/serviceconfig" + "google.golang.org/grpc/xds/internal/balancer/edsbalancer" + "google.golang.org/grpc/xds/internal/balancer/lrs" + cdspb "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/cds" + edspb "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/eds" ) const ( @@ -55,13 +54,11 @@ var ( } ) -func init() { - balancer.Register(newXDSBalancerBuilder()) -} - type xdsBalancerBuilder struct{} -func newXDSBalancerBuilder() balancer.Builder { +// NewBalancerBuilder creates a new implementation of the balancer.Builder +// interface for the xDS balancer. +func NewBalancerBuilder() balancer.Builder { return &xdsBalancerBuilder{} } diff --git a/balancer/xds/xds_client.go b/xds/internal/balancer/xds_client.go similarity index 93% rename from balancer/xds/xds_client.go rename to xds/internal/balancer/xds_client.go index d057f1ece889..14912dd9b374 100644 --- a/balancer/xds/xds_client.go +++ b/xds/internal/balancer/xds_client.go @@ -16,7 +16,7 @@ * */ -package xds +package balancer import ( "context" @@ -28,16 +28,16 @@ import ( structpb "github.com/golang/protobuf/ptypes/struct" "google.golang.org/grpc" "google.golang.org/grpc/balancer" - "google.golang.org/grpc/balancer/xds/internal" - cdspb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/cds" - basepb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/core/base" - discoverypb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/discovery" - edspb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/eds" - adsgrpc "google.golang.org/grpc/balancer/xds/internal/proto/envoy/service/discovery/v2/ads" - "google.golang.org/grpc/balancer/xds/lrs" "google.golang.org/grpc/grpclog" "google.golang.org/grpc/internal/backoff" "google.golang.org/grpc/internal/channelz" + "google.golang.org/grpc/xds/internal" + "google.golang.org/grpc/xds/internal/balancer/lrs" + cdspb "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/cds" + basepb "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/core/base" + discoverypb "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/discovery" + edspb "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/eds" + adsgrpc "google.golang.org/grpc/xds/internal/proto/envoy/service/discovery/v2/ads" ) const ( diff --git a/balancer/xds/xds_client_test.go b/xds/internal/balancer/xds_client_test.go similarity index 94% rename from balancer/xds/xds_client_test.go rename to xds/internal/balancer/xds_client_test.go index 580972f63d4d..4215d5d9a9ab 100644 --- a/balancer/xds/xds_client_test.go +++ b/xds/internal/balancer/xds_client_test.go @@ -16,7 +16,7 @@ * */ -package xds +package balancer import ( "context" @@ -33,18 +33,18 @@ import ( wrpb "github.com/golang/protobuf/ptypes/wrappers" "google.golang.org/grpc" "google.golang.org/grpc/balancer" - "google.golang.org/grpc/balancer/xds/internal" - cdspb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/cds" - addresspb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/core/address" - basepb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/core/base" - discoverypb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/discovery" - edspb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/eds" - endpointpb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/endpoint/endpoint" - adsgrpc "google.golang.org/grpc/balancer/xds/internal/proto/envoy/service/discovery/v2/ads" - lrsgrpc "google.golang.org/grpc/balancer/xds/internal/proto/envoy/service/load_stats/v2/lrs" "google.golang.org/grpc/codes" "google.golang.org/grpc/resolver" "google.golang.org/grpc/status" + "google.golang.org/grpc/xds/internal" + cdspb "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/cds" + addresspb "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/core/address" + basepb "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/core/base" + discoverypb "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/discovery" + edspb "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/eds" + endpointpb "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/endpoint/endpoint" + adsgrpc "google.golang.org/grpc/xds/internal/proto/envoy/service/discovery/v2/ads" + lrsgrpc "google.golang.org/grpc/xds/internal/proto/envoy/service/load_stats/v2/lrs" ) var ( diff --git a/balancer/xds/xds_lrs_test.go b/xds/internal/balancer/xds_lrs_test.go similarity index 92% rename from balancer/xds/xds_lrs_test.go rename to xds/internal/balancer/xds_lrs_test.go index 9b5ff6915979..6fe852769ad3 100644 --- a/balancer/xds/xds_lrs_test.go +++ b/xds/internal/balancer/xds_lrs_test.go @@ -16,7 +16,7 @@ * */ -package xds +package balancer import ( "io" @@ -29,13 +29,13 @@ import ( structpb "github.com/golang/protobuf/ptypes/struct" "github.com/google/go-cmp/cmp" "google.golang.org/grpc/balancer" - "google.golang.org/grpc/balancer/xds/internal" - basepb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/core/base" - lrsgrpc "google.golang.org/grpc/balancer/xds/internal/proto/envoy/service/load_stats/v2/lrs" - lrspb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/service/load_stats/v2/lrs" "google.golang.org/grpc/codes" "google.golang.org/grpc/resolver" "google.golang.org/grpc/status" + "google.golang.org/grpc/xds/internal" + basepb "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/core/base" + lrsgrpc "google.golang.org/grpc/xds/internal/proto/envoy/service/load_stats/v2/lrs" + lrspb "google.golang.org/grpc/xds/internal/proto/envoy/service/load_stats/v2/lrs" ) type lrsServer struct { diff --git a/balancer/xds/xds_test.go b/xds/internal/balancer/xds_test.go similarity index 98% rename from balancer/xds/xds_test.go rename to xds/internal/balancer/xds_test.go index bbc1835a78c3..85bd56a16d13 100644 --- a/balancer/xds/xds_test.go +++ b/xds/internal/balancer/xds_test.go @@ -16,7 +16,7 @@ * */ -package xds +package balancer import ( "encoding/json" @@ -27,18 +27,19 @@ import ( "github.com/golang/protobuf/proto" "google.golang.org/grpc/balancer" - discoverypb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/discovery" - edspb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/eds" - "google.golang.org/grpc/balancer/xds/lrs" "google.golang.org/grpc/connectivity" "google.golang.org/grpc/internal/grpctest" "google.golang.org/grpc/internal/leakcheck" "google.golang.org/grpc/resolver" + "google.golang.org/grpc/xds/internal/balancer/lrs" + discoverypb "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/discovery" + edspb "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/eds" ) var lbABuilder = &balancerABuilder{} func init() { + balancer.Register(&xdsBalancerBuilder{}) balancer.Register(lbABuilder) balancer.Register(&balancerBBuilder{}) } diff --git a/balancer/xds/internal/const.go b/xds/internal/const.go similarity index 100% rename from balancer/xds/internal/const.go rename to xds/internal/const.go diff --git a/balancer/xds/internal/internal.go b/xds/internal/internal.go similarity index 93% rename from balancer/xds/internal/internal.go rename to xds/internal/internal.go index a0d209ccecc1..7403e3f20505 100644 --- a/balancer/xds/internal/internal.go +++ b/xds/internal/internal.go @@ -20,7 +20,7 @@ package internal import ( "fmt" - basepb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/core/base" + basepb "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/core/base" ) // Locality is xds.Locality without XXX fields, so it can be used as map diff --git a/balancer/xds/internal/internal_test.go b/xds/internal/internal_test.go similarity index 95% rename from balancer/xds/internal/internal_test.go rename to xds/internal/internal_test.go index 44a55ab907c9..f1be682978a4 100644 --- a/balancer/xds/internal/internal_test.go +++ b/xds/internal/internal_test.go @@ -24,7 +24,7 @@ import ( "unicode" "github.com/google/go-cmp/cmp" - basepb "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/core/base" + basepb "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/core/base" ) const ignorePrefix = "XXX_" diff --git a/balancer/xds/internal/proto/envoy/api/v2/auth/cert/cert.pb.go b/xds/internal/proto/envoy/api/v2/auth/cert/cert.pb.go similarity index 99% rename from balancer/xds/internal/proto/envoy/api/v2/auth/cert/cert.pb.go rename to xds/internal/proto/envoy/api/v2/auth/cert/cert.pb.go index 8c774248b2f5..d39d9317bfa9 100755 --- a/balancer/xds/internal/proto/envoy/api/v2/auth/cert/cert.pb.go +++ b/xds/internal/proto/envoy/api/v2/auth/cert/cert.pb.go @@ -7,9 +7,9 @@ import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" import wrappers "github.com/golang/protobuf/ptypes/wrappers" -import base "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/core/base" -import config_source "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/core/config_source" -import _ "google.golang.org/grpc/balancer/xds/internal/proto/validate" +import base "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/core/base" +import config_source "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/core/config_source" +import _ "google.golang.org/grpc/xds/internal/proto/validate" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal diff --git a/balancer/xds/internal/proto/envoy/api/v2/cds/cds.pb.go b/xds/internal/proto/envoy/api/v2/cds/cds.pb.go similarity index 98% rename from balancer/xds/internal/proto/envoy/api/v2/cds/cds.pb.go rename to xds/internal/proto/envoy/api/v2/cds/cds.pb.go index 7aa6d6f19e3d..9e7c6adf01da 100755 --- a/balancer/xds/internal/proto/envoy/api/v2/cds/cds.pb.go +++ b/xds/internal/proto/envoy/api/v2/cds/cds.pb.go @@ -11,18 +11,18 @@ import duration "github.com/golang/protobuf/ptypes/duration" import _struct "github.com/golang/protobuf/ptypes/struct" import wrappers "github.com/golang/protobuf/ptypes/wrappers" import _ "google.golang.org/genproto/googleapis/api/annotations" -import cert "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/auth/cert" -import circuit_breaker "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/cluster/circuit_breaker" -import outlier_detection "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/cluster/outlier_detection" -import address "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/core/address" -import base "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/core/base" -import config_source "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/core/config_source" -import health_check "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/core/health_check" -import protocol "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/core/protocol" -import discovery "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/discovery" -import eds "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/eds" -import percent "google.golang.org/grpc/balancer/xds/internal/proto/envoy/type/percent" -import _ "google.golang.org/grpc/balancer/xds/internal/proto/validate" +import cert "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/auth/cert" +import circuit_breaker "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/cluster/circuit_breaker" +import outlier_detection "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/cluster/outlier_detection" +import address "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/core/address" +import base "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/core/base" +import config_source "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/core/config_source" +import health_check "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/core/health_check" +import protocol "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/core/protocol" +import discovery "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/discovery" +import eds "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/eds" +import percent "google.golang.org/grpc/xds/internal/proto/envoy/type/percent" +import _ "google.golang.org/grpc/xds/internal/proto/validate" import ( context "golang.org/x/net/context" diff --git a/balancer/xds/internal/proto/envoy/api/v2/cluster/circuit_breaker/circuit_breaker.pb.go b/xds/internal/proto/envoy/api/v2/cluster/circuit_breaker/circuit_breaker.pb.go similarity index 98% rename from balancer/xds/internal/proto/envoy/api/v2/cluster/circuit_breaker/circuit_breaker.pb.go rename to xds/internal/proto/envoy/api/v2/cluster/circuit_breaker/circuit_breaker.pb.go index f6db35540314..b631f7a714ee 100755 --- a/balancer/xds/internal/proto/envoy/api/v2/cluster/circuit_breaker/circuit_breaker.pb.go +++ b/xds/internal/proto/envoy/api/v2/cluster/circuit_breaker/circuit_breaker.pb.go @@ -7,7 +7,7 @@ import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" import wrappers "github.com/golang/protobuf/ptypes/wrappers" -import base "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/core/base" +import base "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/core/base" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal diff --git a/balancer/xds/internal/proto/envoy/api/v2/cluster/outlier_detection/outlier_detection.pb.go b/xds/internal/proto/envoy/api/v2/cluster/outlier_detection/outlier_detection.pb.go similarity index 99% rename from balancer/xds/internal/proto/envoy/api/v2/cluster/outlier_detection/outlier_detection.pb.go rename to xds/internal/proto/envoy/api/v2/cluster/outlier_detection/outlier_detection.pb.go index 6b60e5d8259e..80ee535390fa 100755 --- a/balancer/xds/internal/proto/envoy/api/v2/cluster/outlier_detection/outlier_detection.pb.go +++ b/xds/internal/proto/envoy/api/v2/cluster/outlier_detection/outlier_detection.pb.go @@ -8,7 +8,7 @@ import fmt "fmt" import math "math" import duration "github.com/golang/protobuf/ptypes/duration" import wrappers "github.com/golang/protobuf/ptypes/wrappers" -import _ "google.golang.org/grpc/balancer/xds/internal/proto/validate" +import _ "google.golang.org/grpc/xds/internal/proto/validate" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal diff --git a/balancer/xds/internal/proto/envoy/api/v2/core/address/address.pb.go b/xds/internal/proto/envoy/api/v2/core/address/address.pb.go similarity index 99% rename from balancer/xds/internal/proto/envoy/api/v2/core/address/address.pb.go rename to xds/internal/proto/envoy/api/v2/core/address/address.pb.go index 85e7fa0b7857..5c54813cf094 100755 --- a/balancer/xds/internal/proto/envoy/api/v2/core/address/address.pb.go +++ b/xds/internal/proto/envoy/api/v2/core/address/address.pb.go @@ -7,8 +7,8 @@ import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" import wrappers "github.com/golang/protobuf/ptypes/wrappers" -import base "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/core/base" -import _ "google.golang.org/grpc/balancer/xds/internal/proto/validate" +import base "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/core/base" +import _ "google.golang.org/grpc/xds/internal/proto/validate" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal diff --git a/balancer/xds/internal/proto/envoy/api/v2/core/base/base.pb.go b/xds/internal/proto/envoy/api/v2/core/base/base.pb.go similarity index 99% rename from balancer/xds/internal/proto/envoy/api/v2/core/base/base.pb.go rename to xds/internal/proto/envoy/api/v2/core/base/base.pb.go index 3adb903059cf..235580479854 100755 --- a/balancer/xds/internal/proto/envoy/api/v2/core/base/base.pb.go +++ b/xds/internal/proto/envoy/api/v2/core/base/base.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // source: envoy/api/v2/core/base.proto -package core +package envoy_api_v2_core import proto "github.com/golang/protobuf/proto" import fmt "fmt" @@ -9,8 +9,8 @@ import math "math" import any "github.com/golang/protobuf/ptypes/any" import _struct "github.com/golang/protobuf/ptypes/struct" import wrappers "github.com/golang/protobuf/ptypes/wrappers" -import percent "google.golang.org/grpc/balancer/xds/internal/proto/envoy/type/percent" -import _ "google.golang.org/grpc/balancer/xds/internal/proto/validate" +import percent "google.golang.org/grpc/xds/internal/proto/envoy/type/percent" +import _ "google.golang.org/grpc/xds/internal/proto/validate" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal diff --git a/balancer/xds/internal/proto/envoy/api/v2/core/config_source/config_source.pb.go b/xds/internal/proto/envoy/api/v2/core/config_source/config_source.pb.go similarity index 99% rename from balancer/xds/internal/proto/envoy/api/v2/core/config_source/config_source.pb.go rename to xds/internal/proto/envoy/api/v2/core/config_source/config_source.pb.go index d8b71b6caa39..9853ff3d9e40 100755 --- a/balancer/xds/internal/proto/envoy/api/v2/core/config_source/config_source.pb.go +++ b/xds/internal/proto/envoy/api/v2/core/config_source/config_source.pb.go @@ -8,8 +8,8 @@ import fmt "fmt" import math "math" import duration "github.com/golang/protobuf/ptypes/duration" import wrappers "github.com/golang/protobuf/ptypes/wrappers" -import grpc_service "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/core/grpc_service" -import _ "google.golang.org/grpc/balancer/xds/internal/proto/validate" +import grpc_service "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/core/grpc_service" +import _ "google.golang.org/grpc/xds/internal/proto/validate" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal diff --git a/balancer/xds/internal/proto/envoy/api/v2/core/grpc_service/grpc_service.pb.go b/xds/internal/proto/envoy/api/v2/core/grpc_service/grpc_service.pb.go similarity index 99% rename from balancer/xds/internal/proto/envoy/api/v2/core/grpc_service/grpc_service.pb.go rename to xds/internal/proto/envoy/api/v2/core/grpc_service/grpc_service.pb.go index 832c2ca26e0c..0f1d143e6a6c 100755 --- a/balancer/xds/internal/proto/envoy/api/v2/core/grpc_service/grpc_service.pb.go +++ b/xds/internal/proto/envoy/api/v2/core/grpc_service/grpc_service.pb.go @@ -10,8 +10,8 @@ import any "github.com/golang/protobuf/ptypes/any" import duration "github.com/golang/protobuf/ptypes/duration" import empty "github.com/golang/protobuf/ptypes/empty" import _struct "github.com/golang/protobuf/ptypes/struct" -import base "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/core/base" -import _ "google.golang.org/grpc/balancer/xds/internal/proto/validate" +import base "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/core/base" +import _ "google.golang.org/grpc/xds/internal/proto/validate" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal diff --git a/balancer/xds/internal/proto/envoy/api/v2/core/health_check/health_check.pb.go b/xds/internal/proto/envoy/api/v2/core/health_check/health_check.pb.go similarity index 99% rename from balancer/xds/internal/proto/envoy/api/v2/core/health_check/health_check.pb.go rename to xds/internal/proto/envoy/api/v2/core/health_check/health_check.pb.go index c2f585762047..4a2f50869d73 100755 --- a/balancer/xds/internal/proto/envoy/api/v2/core/health_check/health_check.pb.go +++ b/xds/internal/proto/envoy/api/v2/core/health_check/health_check.pb.go @@ -10,9 +10,9 @@ import any "github.com/golang/protobuf/ptypes/any" import duration "github.com/golang/protobuf/ptypes/duration" import _struct "github.com/golang/protobuf/ptypes/struct" import wrappers "github.com/golang/protobuf/ptypes/wrappers" -import base "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/core/base" -import _range "google.golang.org/grpc/balancer/xds/internal/proto/envoy/type/range" -import _ "google.golang.org/grpc/balancer/xds/internal/proto/validate" +import base "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/core/base" +import _range "google.golang.org/grpc/xds/internal/proto/envoy/type/range" +import _ "google.golang.org/grpc/xds/internal/proto/validate" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal diff --git a/balancer/xds/internal/proto/envoy/api/v2/core/protocol/protocol.pb.go b/xds/internal/proto/envoy/api/v2/core/protocol/protocol.pb.go similarity index 99% rename from balancer/xds/internal/proto/envoy/api/v2/core/protocol/protocol.pb.go rename to xds/internal/proto/envoy/api/v2/core/protocol/protocol.pb.go index 1c07ca5463b0..d70628680fdb 100755 --- a/balancer/xds/internal/proto/envoy/api/v2/core/protocol/protocol.pb.go +++ b/xds/internal/proto/envoy/api/v2/core/protocol/protocol.pb.go @@ -8,7 +8,7 @@ import fmt "fmt" import math "math" import duration "github.com/golang/protobuf/ptypes/duration" import wrappers "github.com/golang/protobuf/ptypes/wrappers" -import _ "google.golang.org/grpc/balancer/xds/internal/proto/validate" +import _ "google.golang.org/grpc/xds/internal/proto/validate" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal diff --git a/balancer/xds/internal/proto/envoy/api/v2/discovery/discovery.pb.go b/xds/internal/proto/envoy/api/v2/discovery/discovery.pb.go similarity index 99% rename from balancer/xds/internal/proto/envoy/api/v2/discovery/discovery.pb.go rename to xds/internal/proto/envoy/api/v2/discovery/discovery.pb.go index de6f940ab5b5..49e59c38fa56 100755 --- a/balancer/xds/internal/proto/envoy/api/v2/discovery/discovery.pb.go +++ b/xds/internal/proto/envoy/api/v2/discovery/discovery.pb.go @@ -8,7 +8,7 @@ import fmt "fmt" import math "math" import any "github.com/golang/protobuf/ptypes/any" import status "google.golang.org/genproto/googleapis/rpc/status" -import base "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/core/base" +import base "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/core/base" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal diff --git a/balancer/xds/internal/proto/envoy/api/v2/eds/eds.pb.go b/xds/internal/proto/envoy/api/v2/eds/eds.pb.go similarity index 98% rename from balancer/xds/internal/proto/envoy/api/v2/eds/eds.pb.go rename to xds/internal/proto/envoy/api/v2/eds/eds.pb.go index cd89e5798523..3c00b69c0a1f 100755 --- a/balancer/xds/internal/proto/envoy/api/v2/eds/eds.pb.go +++ b/xds/internal/proto/envoy/api/v2/eds/eds.pb.go @@ -9,10 +9,10 @@ import math "math" import duration "github.com/golang/protobuf/ptypes/duration" import wrappers "github.com/golang/protobuf/ptypes/wrappers" import _ "google.golang.org/genproto/googleapis/api/annotations" -import discovery "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/discovery" -import endpoint "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/endpoint/endpoint" -import percent "google.golang.org/grpc/balancer/xds/internal/proto/envoy/type/percent" -import _ "google.golang.org/grpc/balancer/xds/internal/proto/validate" +import discovery "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/discovery" +import endpoint "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/endpoint/endpoint" +import percent "google.golang.org/grpc/xds/internal/proto/envoy/type/percent" +import _ "google.golang.org/grpc/xds/internal/proto/validate" import ( context "golang.org/x/net/context" diff --git a/balancer/xds/internal/proto/envoy/api/v2/endpoint/endpoint/endpoint.pb.go b/xds/internal/proto/envoy/api/v2/endpoint/endpoint/endpoint.pb.go similarity index 97% rename from balancer/xds/internal/proto/envoy/api/v2/endpoint/endpoint/endpoint.pb.go rename to xds/internal/proto/envoy/api/v2/endpoint/endpoint/endpoint.pb.go index a99c51e234d7..36f851043cff 100755 --- a/balancer/xds/internal/proto/envoy/api/v2/endpoint/endpoint/endpoint.pb.go +++ b/xds/internal/proto/envoy/api/v2/endpoint/endpoint/endpoint.pb.go @@ -7,10 +7,10 @@ import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" import wrappers "github.com/golang/protobuf/ptypes/wrappers" -import address "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/core/address" -import base "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/core/base" -import health_check "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/core/health_check" -import _ "google.golang.org/grpc/balancer/xds/internal/proto/validate" +import address "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/core/address" +import base "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/core/base" +import health_check "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/core/health_check" +import _ "google.golang.org/grpc/xds/internal/proto/validate" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal diff --git a/balancer/xds/internal/proto/envoy/api/v2/endpoint/load_report/load_report.pb.go b/xds/internal/proto/envoy/api/v2/endpoint/load_report/load_report.pb.go similarity index 98% rename from balancer/xds/internal/proto/envoy/api/v2/endpoint/load_report/load_report.pb.go rename to xds/internal/proto/envoy/api/v2/endpoint/load_report/load_report.pb.go index cc44f44761f3..5d6217f25913 100755 --- a/balancer/xds/internal/proto/envoy/api/v2/endpoint/load_report/load_report.pb.go +++ b/xds/internal/proto/envoy/api/v2/endpoint/load_report/load_report.pb.go @@ -8,9 +8,9 @@ import fmt "fmt" import math "math" import duration "github.com/golang/protobuf/ptypes/duration" import _struct "github.com/golang/protobuf/ptypes/struct" -import address "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/core/address" -import base "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/core/base" -import _ "google.golang.org/grpc/balancer/xds/internal/proto/validate" +import address "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/core/address" +import base "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/core/base" +import _ "google.golang.org/grpc/xds/internal/proto/validate" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal diff --git a/balancer/xds/internal/proto/envoy/service/discovery/v2/ads/ads.pb.go b/xds/internal/proto/envoy/service/discovery/v2/ads/ads.pb.go similarity index 99% rename from balancer/xds/internal/proto/envoy/service/discovery/v2/ads/ads.pb.go rename to xds/internal/proto/envoy/service/discovery/v2/ads/ads.pb.go index 2efdb00eb522..afd8083893ce 100755 --- a/balancer/xds/internal/proto/envoy/service/discovery/v2/ads/ads.pb.go +++ b/xds/internal/proto/envoy/service/discovery/v2/ads/ads.pb.go @@ -6,7 +6,7 @@ package v2 import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" -import discovery "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/discovery" +import discovery "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/discovery" import ( context "golang.org/x/net/context" diff --git a/balancer/xds/internal/proto/envoy/service/load_stats/v2/lrs/lrs.pb.go b/xds/internal/proto/envoy/service/load_stats/v2/lrs/lrs.pb.go similarity index 97% rename from balancer/xds/internal/proto/envoy/service/load_stats/v2/lrs/lrs.pb.go rename to xds/internal/proto/envoy/service/load_stats/v2/lrs/lrs.pb.go index 87a16d284534..b0825d472482 100755 --- a/balancer/xds/internal/proto/envoy/service/load_stats/v2/lrs/lrs.pb.go +++ b/xds/internal/proto/envoy/service/load_stats/v2/lrs/lrs.pb.go @@ -7,9 +7,9 @@ import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" import duration "github.com/golang/protobuf/ptypes/duration" -import base "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/core/base" -import load_report "google.golang.org/grpc/balancer/xds/internal/proto/envoy/api/v2/endpoint/load_report" -import _ "google.golang.org/grpc/balancer/xds/internal/proto/validate" +import base "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/core/base" +import load_report "google.golang.org/grpc/xds/internal/proto/envoy/api/v2/endpoint/load_report" +import _ "google.golang.org/grpc/xds/internal/proto/validate" import ( context "golang.org/x/net/context" diff --git a/balancer/xds/internal/proto/envoy/type/percent/percent.pb.go b/xds/internal/proto/envoy/type/percent/percent.pb.go similarity index 98% rename from balancer/xds/internal/proto/envoy/type/percent/percent.pb.go rename to xds/internal/proto/envoy/type/percent/percent.pb.go index 423dbdcf55d3..e30f1a5758b2 100755 --- a/balancer/xds/internal/proto/envoy/type/percent/percent.pb.go +++ b/xds/internal/proto/envoy/type/percent/percent.pb.go @@ -6,7 +6,7 @@ package envoy_type import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" -import _ "google.golang.org/grpc/balancer/xds/internal/proto/validate" +import _ "google.golang.org/grpc/xds/internal/proto/validate" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal diff --git a/balancer/xds/internal/proto/envoy/type/range/range.pb.go b/xds/internal/proto/envoy/type/range/range.pb.go similarity index 100% rename from balancer/xds/internal/proto/envoy/type/range/range.pb.go rename to xds/internal/proto/envoy/type/range/range.pb.go diff --git a/balancer/xds/internal/proto/udpa/data/orca/v1/orca_load_report/orca_load_report.pb.go b/xds/internal/proto/udpa/data/orca/v1/orca_load_report/orca_load_report.pb.go similarity index 98% rename from balancer/xds/internal/proto/udpa/data/orca/v1/orca_load_report/orca_load_report.pb.go rename to xds/internal/proto/udpa/data/orca/v1/orca_load_report/orca_load_report.pb.go index 991f932a685c..0ab45d8c2d85 100755 --- a/balancer/xds/internal/proto/udpa/data/orca/v1/orca_load_report/orca_load_report.pb.go +++ b/xds/internal/proto/udpa/data/orca/v1/orca_load_report/orca_load_report.pb.go @@ -6,7 +6,7 @@ package v1 import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" -import _ "google.golang.org/grpc/balancer/xds/internal/proto/validate" +import _ "google.golang.org/grpc/xds/internal/proto/validate" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal diff --git a/balancer/xds/internal/proto/udpa/service/orca/v1/orca/orca.pb.go b/xds/internal/proto/udpa/service/orca/v1/orca/orca.pb.go similarity index 97% rename from balancer/xds/internal/proto/udpa/service/orca/v1/orca/orca.pb.go rename to xds/internal/proto/udpa/service/orca/v1/orca/orca.pb.go index 6fd191e00caf..d7613b6933f2 100755 --- a/balancer/xds/internal/proto/udpa/service/orca/v1/orca/orca.pb.go +++ b/xds/internal/proto/udpa/service/orca/v1/orca/orca.pb.go @@ -7,8 +7,8 @@ import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" import duration "github.com/golang/protobuf/ptypes/duration" -import orca_load_report "google.golang.org/grpc/balancer/xds/internal/proto/udpa/data/orca/v1/orca_load_report" -import _ "google.golang.org/grpc/balancer/xds/internal/proto/validate" +import orca_load_report "google.golang.org/grpc/xds/internal/proto/udpa/data/orca/v1/orca_load_report" +import _ "google.golang.org/grpc/xds/internal/proto/validate" import ( context "golang.org/x/net/context" diff --git a/balancer/xds/internal/proto/validate/validate.pb.go b/xds/internal/proto/validate/validate.pb.go similarity index 99% rename from balancer/xds/internal/proto/validate/validate.pb.go rename to xds/internal/proto/validate/validate.pb.go index b8af88dd8218..f46210c8ae3c 100755 --- a/balancer/xds/internal/proto/validate/validate.pb.go +++ b/xds/internal/proto/validate/validate.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // source: validate/validate.proto -package validate // import "google.golang.org/grpc/balancer/xds/internal/proto/validate" +package validate // import "google.golang.org/grpc/xds/internal/proto/validate" import proto "github.com/golang/protobuf/proto" import fmt "fmt" diff --git a/balancer/xds/internal/regenerate_scripts/README.md b/xds/internal/regenerate_scripts/README.md similarity index 93% rename from balancer/xds/internal/regenerate_scripts/README.md rename to xds/internal/regenerate_scripts/README.md index d9c4fb00c30e..504770d706fd 100644 --- a/balancer/xds/internal/regenerate_scripts/README.md +++ b/xds/internal/regenerate_scripts/README.md @@ -1,7 +1,7 @@ ## Generate new pb.go files 1. Update -[DATA_PLANE_API_VERSION](https://github.com/grpc/grpc-go/blob/master/balancer/xds/internal/regenerate_scripts/envoy-proto-gen.sh#L3) +[DATA_PLANE_API_VERSION](https://github.com/grpc/grpc-go/blob/master/xds/internal/regenerate_scripts/envoy-proto-gen.sh#L3) to a new commit for [envoyproxy/data-plane-api](https://github.com/envoyproxy/data-plane-api/commits/master). 1. Run `./envoy-proto-gen.sh` in __this__ directory (and fingers crossed). diff --git a/balancer/xds/internal/regenerate_scripts/envoy-proto-gen.sh b/xds/internal/regenerate_scripts/envoy-proto-gen.sh similarity index 93% rename from balancer/xds/internal/regenerate_scripts/envoy-proto-gen.sh rename to xds/internal/regenerate_scripts/envoy-proto-gen.sh index f68ab236094d..0b0f1b54c1fc 100755 --- a/balancer/xds/internal/regenerate_scripts/envoy-proto-gen.sh +++ b/xds/internal/regenerate_scripts/envoy-proto-gen.sh @@ -27,6 +27,6 @@ cd ../data-plane-api git apply ../utils/data-plane-api.patch # proto-gen.sh build all packages required for grpc xds implementation and move -# proto generated code to grpc/balancer/xds/internal/proto subdirectory. +# proto generated code to grpc/xds/internal/proto subdirectory. ../utils/proto-gen.sh diff --git a/balancer/xds/internal/regenerate_scripts/utils/README.md b/xds/internal/regenerate_scripts/utils/README.md similarity index 100% rename from balancer/xds/internal/regenerate_scripts/utils/README.md rename to xds/internal/regenerate_scripts/utils/README.md diff --git a/balancer/xds/internal/regenerate_scripts/utils/WORKSPACE b/xds/internal/regenerate_scripts/utils/WORKSPACE similarity index 100% rename from balancer/xds/internal/regenerate_scripts/utils/WORKSPACE rename to xds/internal/regenerate_scripts/utils/WORKSPACE diff --git a/balancer/xds/internal/regenerate_scripts/utils/cleanup.sh b/xds/internal/regenerate_scripts/utils/cleanup.sh similarity index 100% rename from balancer/xds/internal/regenerate_scripts/utils/cleanup.sh rename to xds/internal/regenerate_scripts/utils/cleanup.sh diff --git a/balancer/xds/internal/regenerate_scripts/utils/data-plane-api.patch b/xds/internal/regenerate_scripts/utils/data-plane-api.patch similarity index 94% rename from balancer/xds/internal/regenerate_scripts/utils/data-plane-api.patch rename to xds/internal/regenerate_scripts/utils/data-plane-api.patch index b7256dfe234b..a0fc9752c4fc 100644 --- a/balancer/xds/internal/regenerate_scripts/utils/data-plane-api.patch +++ b/xds/internal/regenerate_scripts/utils/data-plane-api.patch @@ -7,7 +7,7 @@ index c68ccbd..e6cc8cb 100644 _GO_PROTO_SUFFIX = "_go_proto" _GO_GRPC_SUFFIX = "_go_grpc" -_GO_IMPORTPATH_PREFIX = "github.com/envoyproxy/data-plane-api/api/" -+_GO_IMPORTPATH_PREFIX = "google.golang.org/grpc/balancer/xds/internal/proto/" ++_GO_IMPORTPATH_PREFIX = "google.golang.org/grpc/xds/internal/proto/" def _Suffix(d, suffix): return d + suffix diff --git a/balancer/xds/internal/regenerate_scripts/utils/proto-gen.sh b/xds/internal/regenerate_scripts/utils/proto-gen.sh similarity index 100% rename from balancer/xds/internal/regenerate_scripts/utils/proto-gen.sh rename to xds/internal/regenerate_scripts/utils/proto-gen.sh diff --git a/balancer/xds/internal/regenerate_scripts/utils/protoc-gen-validate.patch b/xds/internal/regenerate_scripts/utils/protoc-gen-validate.patch similarity index 81% rename from balancer/xds/internal/regenerate_scripts/utils/protoc-gen-validate.patch rename to xds/internal/regenerate_scripts/utils/protoc-gen-validate.patch index 414eb1c77bb9..9ef5cefbda81 100644 --- a/balancer/xds/internal/regenerate_scripts/utils/protoc-gen-validate.patch +++ b/xds/internal/regenerate_scripts/utils/protoc-gen-validate.patch @@ -7,7 +7,7 @@ index 8a3d063..939d997 100644 go_proto_library( name = "go_default_library", - importpath = "github.com/envoyproxy/protoc-gen-validate/validate", -+ importpath = "google.golang.org/grpc/balancer/xds/internal/proto/validate", ++ importpath = "google.golang.org/grpc/xds/internal/proto/validate", proto = ":validate_proto", visibility = ["//visibility:public"], ) @@ -20,7 +20,7 @@ index 864ad86..6165f39 100644 package validate; -option go_package = "github.com/envoyproxy/protoc-gen-validate/validate"; -+option go_package = "google.golang.org/grpc/balancer/xds/internal/proto/validate"; ++option go_package = "google.golang.org/grpc/xds/internal/proto/validate"; option java_package = "io.envoyproxy.pgv.validate"; import "google/protobuf/descriptor.proto";