瀏覽代碼

*: pass WithInsecure to grpc.Dial for now

Related to https://github.com/coreos/etcd/issues/4299.
Gyu-Ho Lee 10 年之前
父節點
當前提交
fa21946267

+ 2 - 1
etcdctlv3/command/compaction_command.go

@@ -48,7 +48,8 @@ func compactionCommandFunc(cmd *cobra.Command, args []string) {
 	if err != nil {
 		ExitWithError(ExitError, err)
 	}
-	conn, err := grpc.Dial(endpoint)
+	// TODO: enable grpc.WithTransportCredentials(creds)
+	conn, err := grpc.Dial(endpoint, grpc.WithInsecure())
 	if err != nil {
 		ExitWithError(ExitBadConnection, err)
 	}

+ 2 - 1
etcdctlv3/command/delete_range_command.go

@@ -48,7 +48,8 @@ func deleteRangeCommandFunc(cmd *cobra.Command, args []string) {
 	if err != nil {
 		ExitWithError(ExitError, err)
 	}
-	conn, err := grpc.Dial(endpoint)
+	// TODO: enable grpc.WithTransportCredentials(creds)
+	conn, err := grpc.Dial(endpoint, grpc.WithInsecure())
 	if err != nil {
 		ExitWithError(ExitBadConnection, err)
 	}

+ 6 - 3
etcdctlv3/command/lease_command.go

@@ -68,7 +68,8 @@ func leaseCreateCommandFunc(cmd *cobra.Command, args []string) {
 	if err != nil {
 		ExitWithError(ExitError, err)
 	}
-	conn, err := grpc.Dial(endpoint)
+	// TODO: enable grpc.WithTransportCredentials(creds)
+	conn, err := grpc.Dial(endpoint, grpc.WithInsecure())
 	if err != nil {
 		ExitWithError(ExitBadConnection, err)
 	}
@@ -110,7 +111,8 @@ func leaseRevokeCommandFunc(cmd *cobra.Command, args []string) {
 	if err != nil {
 		ExitWithError(ExitError, err)
 	}
-	conn, err := grpc.Dial(endpoint)
+	// TODO: enable grpc.WithTransportCredentials(creds)
+	conn, err := grpc.Dial(endpoint, grpc.WithInsecure())
 	if err != nil {
 		ExitWithError(ExitBadConnection, err)
 	}
@@ -152,7 +154,8 @@ func leaseKeepAliveCommandFunc(cmd *cobra.Command, args []string) {
 	if err != nil {
 		ExitWithError(ExitError, err)
 	}
-	conn, err := grpc.Dial(endpoint)
+	// TODO: enable grpc.WithTransportCredentials(creds)
+	conn, err := grpc.Dial(endpoint, grpc.WithInsecure())
 	if err != nil {
 		ExitWithError(ExitBadConnection, err)
 	}

+ 8 - 4
etcdctlv3/command/member_command.go

@@ -113,7 +113,8 @@ func memberAddCommandFunc(cmd *cobra.Command, args []string) {
 	if err != nil {
 		ExitWithError(ExitError, err)
 	}
-	conn, err := grpc.Dial(endpoint)
+	// TODO: enable grpc.WithTransportCredentials(creds)
+	conn, err := grpc.Dial(endpoint, grpc.WithInsecure())
 	if err != nil {
 		ExitWithError(ExitBadConnection, err)
 	}
@@ -142,7 +143,8 @@ func memberRemoveCommandFunc(cmd *cobra.Command, args []string) {
 	if err != nil {
 		ExitWithError(ExitError, err)
 	}
-	conn, err := grpc.Dial(endpoint)
+	// TODO: enable grpc.WithTransportCredentials(creds)
+	conn, err := grpc.Dial(endpoint, grpc.WithInsecure())
 	if err != nil {
 		ExitWithError(ExitBadConnection, err)
 	}
@@ -177,7 +179,8 @@ func memberUpdateCommandFunc(cmd *cobra.Command, args []string) {
 	if err != nil {
 		ExitWithError(ExitError, err)
 	}
-	conn, err := grpc.Dial(endpoint)
+	// TODO: enable grpc.WithTransportCredentials(creds)
+	conn, err := grpc.Dial(endpoint, grpc.WithInsecure())
 	if err != nil {
 		ExitWithError(ExitBadConnection, err)
 	}
@@ -197,7 +200,8 @@ func memberListCommandFunc(cmd *cobra.Command, args []string) {
 	if err != nil {
 		ExitWithError(ExitError, err)
 	}
-	conn, err := grpc.Dial(endpoint)
+	// TODO: enable grpc.WithTransportCredentials(creds)
+	conn, err := grpc.Dial(endpoint, grpc.WithInsecure())
 	if err != nil {
 		ExitWithError(ExitBadConnection, err)
 	}

+ 2 - 1
etcdctlv3/command/put_command.go

@@ -66,7 +66,8 @@ func putCommandFunc(cmd *cobra.Command, args []string) {
 	if err != nil {
 		ExitWithError(ExitError, err)
 	}
-	conn, err := grpc.Dial(endpoint)
+	// TODO: enable grpc.WithTransportCredentials(creds)
+	conn, err := grpc.Dial(endpoint, grpc.WithInsecure())
 	if err != nil {
 		ExitWithError(ExitBadConnection, err)
 	}

+ 2 - 1
etcdctlv3/command/range_command.go

@@ -92,7 +92,8 @@ func rangeCommandFunc(cmd *cobra.Command, args []string) {
 		ExitWithError(ExitBadFeature, fmt.Errorf("bad sort target %v", rangeSortTarget))
 	}
 
-	conn, err := grpc.Dial(endpoint)
+	// TODO: enable grpc.WithTransportCredentials(creds)
+	conn, err := grpc.Dial(endpoint, grpc.WithInsecure())
 	if err != nil {
 		ExitWithError(ExitBadConnection, err)
 	}

+ 2 - 1
etcdctlv3/command/txn_command.go

@@ -54,7 +54,8 @@ func txnCommandFunc(cmd *cobra.Command, args []string) {
 	if err != nil {
 		ExitWithError(ExitError, err)
 	}
-	conn, err := grpc.Dial(endpoint)
+	// TODO: enable grpc.WithTransportCredentials(creds)
+	conn, err := grpc.Dial(endpoint, grpc.WithInsecure())
 	if err != nil {
 		ExitWithError(ExitBadConnection, err)
 	}

+ 2 - 1
etcdctlv3/command/watch_command.go

@@ -43,7 +43,8 @@ func watchCommandFunc(cmd *cobra.Command, args []string) {
 	if err != nil {
 		ExitWithError(ExitInvalidInput, err)
 	}
-	conn, err := grpc.Dial(endpoint)
+	// TODO: enable grpc.WithTransportCredentials(creds)
+	conn, err := grpc.Dial(endpoint, grpc.WithInsecure())
 	if err != nil {
 		ExitWithError(ExitBadConnection, err)
 	}

+ 1 - 1
tools/benchmark/cmd/util.go

@@ -33,7 +33,7 @@ func mustCreateConn() *grpc.ClientConn {
 	eps := strings.Split(endpoints, ",")
 	endpoint := eps[dialTotal%len(eps)]
 	dialTotal++
-	conn, err := grpc.Dial(endpoint)
+	conn, err := grpc.Dial(endpoint, grpc.WithInsecure())
 	if err != nil {
 		fmt.Fprintf(os.Stderr, "dial error: %v\n", err)
 		os.Exit(1)