vendor update for CSI 0.3.0

This commit is contained in:
gman
2018-07-18 16:47:22 +02:00
parent 6f484f92fc
commit 8ea659f0d5
6810 changed files with 438061 additions and 193861 deletions

View File

@ -25,6 +25,7 @@ import (
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/credentials/alts"
"google.golang.org/grpc/grpclog"
"google.golang.org/grpc/interop"
testpb "google.golang.org/grpc/interop/grpc_testing"
@ -32,14 +33,19 @@ import (
)
var (
useTLS = flag.Bool("use_tls", false, "Connection uses TLS if true, else plain TCP")
certFile = flag.String("tls_cert_file", "", "The TLS cert file")
keyFile = flag.String("tls_key_file", "", "The TLS key file")
port = flag.Int("port", 10000, "The server port")
useTLS = flag.Bool("use_tls", false, "Connection uses TLS if true, else plain TCP")
useALTS = flag.Bool("use_alts", false, "Connection uses ALTS if true (this option can only be used on GCP)")
altsHSAddr = flag.String("alts_handshaker_service_address", "", "ALTS handshaker gRPC service address")
certFile = flag.String("tls_cert_file", "", "The TLS cert file")
keyFile = flag.String("tls_key_file", "", "The TLS key file")
port = flag.Int("port", 10000, "The server port")
)
func main() {
flag.Parse()
if *useTLS && *useALTS {
grpclog.Fatalf("use_tls and use_alts cannot be both set to true")
}
p := strconv.Itoa(*port)
lis, err := net.Listen("tcp", ":"+p)
if err != nil {
@ -57,7 +63,14 @@ func main() {
if err != nil {
grpclog.Fatalf("Failed to generate credentials %v", err)
}
opts = []grpc.ServerOption{grpc.Creds(creds)}
opts = append(opts, grpc.Creds(creds))
} else if *useALTS {
altsOpts := alts.DefaultServerOptions()
if *altsHSAddr != "" {
altsOpts.HandshakerServiceAddress = *altsHSAddr
}
altsTC := alts.NewServerCreds(altsOpts)
opts = append(opts, grpc.Creds(altsTC))
}
server := grpc.NewServer(opts...)
testpb.RegisterTestServiceServer(server, interop.NewTestServer())