etcdctlv3: consolidate dial code; use clientv3
This commit is contained in:
@ -20,7 +20,6 @@ import (
|
||||
|
||||
"github.com/coreos/etcd/Godeps/_workspace/src/github.com/spf13/cobra"
|
||||
"github.com/coreos/etcd/Godeps/_workspace/src/golang.org/x/net/context"
|
||||
"github.com/coreos/etcd/Godeps/_workspace/src/google.golang.org/grpc"
|
||||
pb "github.com/coreos/etcd/etcdserver/etcdserverpb"
|
||||
)
|
||||
|
||||
@ -44,17 +43,6 @@ func compactionCommandFunc(cmd *cobra.Command, args []string) {
|
||||
ExitWithError(ExitError, err)
|
||||
}
|
||||
|
||||
endpoint, err := cmd.Flags().GetString("endpoint")
|
||||
if err != nil {
|
||||
ExitWithError(ExitError, err)
|
||||
}
|
||||
// TODO: enable grpc.WithTransportCredentials(creds)
|
||||
conn, err := grpc.Dial(endpoint, grpc.WithInsecure())
|
||||
if err != nil {
|
||||
ExitWithError(ExitBadConnection, err)
|
||||
}
|
||||
kv := pb.NewKVClient(conn)
|
||||
req := &pb.CompactionRequest{Revision: rev}
|
||||
|
||||
kv.Compact(context.Background(), req)
|
||||
mustClient(cmd).KV.Compact(context.Background(), req)
|
||||
}
|
||||
|
Reference in New Issue
Block a user