Port ctr to use client

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby
2017-06-05 16:17:37 -07:00
parent bdf9f5f738
commit 4c1af8fdd8
26 changed files with 526 additions and 1179 deletions

View File

@@ -6,7 +6,6 @@ import (
"os"
"github.com/containerd/containerd/version"
empty "github.com/golang/protobuf/ptypes/empty"
"github.com/urfave/cli"
)
@@ -21,14 +20,15 @@ var versionCommand = cli.Command{
fmt.Printf(" Version: %s\n", version.Version)
fmt.Printf(" Revision: %s\n", version.Revision)
fmt.Println("")
vs, err := getVersionService(context)
client, err := newClient(context)
if err != nil {
return err
}
v, err := vs.Version(gocontext.Background(), &empty.Empty{})
v, err := client.Version(gocontext.Background())
if err != nil {
return err
}
fmt.Println("Server:")
fmt.Printf(" Version: %s\n", v.Version)
fmt.Printf(" Revision: %s\n", v.Revision)