*: pass WithInsecure to grpc.Dial for now

Related to https://github.com/coreos/etcd/issues/4299.
This commit is contained in:
Gyu-Ho Lee 2016-01-27 00:24:03 -08:00
parent 14255854d8
commit fa21946267
9 changed files with 27 additions and 14 deletions

View File

@ -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)
}

View File

@ -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)
}

View File

@ -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)
}

View File

@ -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)
}

View File

@ -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)
}

View File

@ -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)
}

View File

@ -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)
}

View File

@ -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)
}

View File

@ -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)