diff --git a/examples/features/xds/README.md b/examples/features/xds/README.md index eba96d38f..8cf8c4413 100644 --- a/examples/features/xds/README.md +++ b/examples/features/xds/README.md @@ -9,13 +9,11 @@ hello world example](https://github.com/grpc/grpc-go/tree/master/examples/helloworld). The server replies with responses including its hostname. -**Note** that xDS support is incomplete and experimental, with limited -compatibility. - ## xDS environment setup -This example doesn't include instuctions to setup xDS environment. Please -refer to documentation specific for your xDS management server. +This example doesn't include instructions to setup xDS environment. Please refer +to documentation specific for your xDS management server. Examples will be added +later. The client also needs a bootstrap file. See [gRFC A27](https://github.com/grpc/proposal/blob/master/A27-xds-global-load-balancing.md#xdsclient-and-bootstrap-file) @@ -26,7 +24,7 @@ for the bootstrap format. The client application needs to import the xDS package to install the resolver and balancers: ```go -_ "google.golang.org/grpc/xds/experimental" // To install the xds resolvers and balancers. +_ "google.golang.org/grpc/xds" // To install the xds resolvers and balancers. ``` Then, use `xds` target scheme for the ClientConn. diff --git a/examples/features/xds/client/main.go b/examples/features/xds/client/main.go index 3f1a53871..ea50f0945 100644 --- a/examples/features/xds/client/main.go +++ b/examples/features/xds/client/main.go @@ -31,6 +31,7 @@ import ( "google.golang.org/grpc" pb "google.golang.org/grpc/examples/helloworld/helloworld" + // TODO: change this to xds after the xds package is released. _ "google.golang.org/grpc/xds/experimental" // To install the xds resolvers and balancers. ) diff --git a/interop/xds/client/client.go b/interop/xds/client/client.go index de3e1ebf8..009ad26f9 100644 --- a/interop/xds/client/client.go +++ b/interop/xds/client/client.go @@ -31,7 +31,7 @@ import ( "google.golang.org/grpc/grpclog" testpb "google.golang.org/grpc/interop/grpc_testing" "google.golang.org/grpc/peer" - _ "google.golang.org/grpc/xds/experimental" + _ "google.golang.org/grpc/xds" ) type statsWatcherKey struct { diff --git a/xds/experimental/xds_experimental.go b/xds/experimental/xds_experimental.go index 058beb65c..b7ac3019e 100644 --- a/xds/experimental/xds_experimental.go +++ b/xds/experimental/xds_experimental.go @@ -16,13 +16,14 @@ * */ -// 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 contains xds implementation. Users only need to import +// this package to get all xds functionality. +// +// Deprecated: import package xds instead. package experimental +// TODO: remove this package after one release. + import ( - _ "google.golang.org/grpc/xds/internal/balancer" // Register the balancers. - _ "google.golang.org/grpc/xds/internal/resolver" // Register the xds_resolver + _ "google.golang.org/grpc/xds" // Register the balancers and resolvers. ) diff --git a/xds/xds.go b/xds/xds.go new file mode 100644 index 000000000..e077a6947 --- /dev/null +++ b/xds/xds.go @@ -0,0 +1,29 @@ +/* + * + * Copyright 2020 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 xds contains xds implementation. Users need to import this package to +// get all xds functionality. +// +// See https://github.com/grpc/grpc-go/tree/master/examples/features/xds for +// example. +package xds + +import ( + _ "google.golang.org/grpc/xds/internal/balancer" // Register the balancers. + _ "google.golang.org/grpc/xds/internal/resolver" // Register the xds_resolver +)