Revert "Use protoversion for containerd version"
This reverts commit d2e319523d
.
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
This commit is contained in:
parent
c141cb670f
commit
e55ebadb09
5 changed files with 4 additions and 48 deletions
|
@ -9,8 +9,6 @@ import (
|
||||||
"syscall"
|
"syscall"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"go.pedge.io/proto/version"
|
|
||||||
|
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
|
|
||||||
"github.com/Sirupsen/logrus"
|
"github.com/Sirupsen/logrus"
|
||||||
|
@ -80,7 +78,7 @@ var daemonFlags = []cli.Flag{
|
||||||
func main() {
|
func main() {
|
||||||
app := cli.NewApp()
|
app := cli.NewApp()
|
||||||
app.Name = "containerd"
|
app.Name = "containerd"
|
||||||
app.Version = containerd.Version.VersionString()
|
app.Version = containerd.Version
|
||||||
app.Usage = Usage
|
app.Usage = Usage
|
||||||
app.Authors = authors
|
app.Authors = authors
|
||||||
app.Flags = daemonFlags
|
app.Flags = daemonFlags
|
||||||
|
@ -217,15 +215,6 @@ func daemon(id, address, stateDir string, concurrency int, oom bool) error {
|
||||||
}
|
}
|
||||||
s := grpc.NewServer()
|
s := grpc.NewServer()
|
||||||
types.RegisterAPIServer(s, server.NewServer(sv))
|
types.RegisterAPIServer(s, server.NewServer(sv))
|
||||||
protoversion.RegisterAPIServer(
|
|
||||||
s,
|
|
||||||
protoversion.NewAPIServer(
|
|
||||||
containerd.Version,
|
|
||||||
protoversion.APIServerOptions{
|
|
||||||
DisableLogging: true,
|
|
||||||
},
|
|
||||||
),
|
|
||||||
)
|
|
||||||
logrus.Debugf("GRPC API listen on %s", address)
|
logrus.Debugf("GRPC API listen on %s", address)
|
||||||
return s.Serve(l)
|
return s.Serve(l)
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,10 +23,6 @@ import (
|
||||||
|
|
||||||
// TODO: parse flags and pass opts
|
// TODO: parse flags and pass opts
|
||||||
func getClient(ctx *cli.Context) types.APIClient {
|
func getClient(ctx *cli.Context) types.APIClient {
|
||||||
return types.NewAPIClient(getClientConn(ctx))
|
|
||||||
}
|
|
||||||
|
|
||||||
func getClientConn(ctx *cli.Context) *grpc.ClientConn {
|
|
||||||
dialOpts := []grpc.DialOption{grpc.WithInsecure()}
|
dialOpts := []grpc.DialOption{grpc.WithInsecure()}
|
||||||
dialOpts = append(dialOpts,
|
dialOpts = append(dialOpts,
|
||||||
grpc.WithDialer(func(addr string, timeout time.Duration) (net.Conn, error) {
|
grpc.WithDialer(func(addr string, timeout time.Duration) (net.Conn, error) {
|
||||||
|
@ -37,7 +33,7 @@ func getClientConn(ctx *cli.Context) *grpc.ClientConn {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fatal(err.Error(), 1)
|
fatal(err.Error(), 1)
|
||||||
}
|
}
|
||||||
return conn
|
return types.NewAPIClient(conn)
|
||||||
}
|
}
|
||||||
|
|
||||||
var ContainersCommand = cli.Command{
|
var ContainersCommand = cli.Command{
|
||||||
|
|
|
@ -14,7 +14,7 @@ const Usage = `High performance container daemon cli`
|
||||||
func main() {
|
func main() {
|
||||||
app := cli.NewApp()
|
app := cli.NewApp()
|
||||||
app.Name = "ctr"
|
app.Name = "ctr"
|
||||||
app.Version = containerd.Version.VersionString()
|
app.Version = containerd.Version
|
||||||
app.Usage = Usage
|
app.Usage = Usage
|
||||||
app.Authors = []cli.Author{
|
app.Authors = []cli.Author{
|
||||||
{
|
{
|
||||||
|
@ -37,7 +37,6 @@ func main() {
|
||||||
CheckpointCommand,
|
CheckpointCommand,
|
||||||
ContainersCommand,
|
ContainersCommand,
|
||||||
EventsCommand,
|
EventsCommand,
|
||||||
VersionCommand,
|
|
||||||
}
|
}
|
||||||
app.Before = func(context *cli.Context) error {
|
app.Before = func(context *cli.Context) error {
|
||||||
if context.GlobalBool("debug") {
|
if context.GlobalBool("debug") {
|
||||||
|
|
|
@ -1,22 +0,0 @@
|
||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"fmt"
|
|
||||||
|
|
||||||
"go.pedge.io/proto/version"
|
|
||||||
|
|
||||||
"github.com/codegangsta/cli"
|
|
||||||
"github.com/docker/containerd"
|
|
||||||
)
|
|
||||||
|
|
||||||
var VersionCommand = cli.Command{
|
|
||||||
Name: "version",
|
|
||||||
Usage: "get the containerd version",
|
|
||||||
Action: func(context *cli.Context) {
|
|
||||||
serverVersion, err := protoversion.GetServerVersion(getClientConn(context))
|
|
||||||
if err != nil {
|
|
||||||
fatal(err.Error(), 1)
|
|
||||||
}
|
|
||||||
fmt.Printf("Client: %s\nServer: %s\n", containerd.Version.VersionString(), serverVersion.VersionString())
|
|
||||||
},
|
|
||||||
}
|
|
|
@ -1,9 +1,3 @@
|
||||||
package containerd
|
package containerd
|
||||||
|
|
||||||
import "go.pedge.io/proto/version"
|
const Version = "0.0.4"
|
||||||
|
|
||||||
var Version = &protoversion.Version{
|
|
||||||
Major: 0,
|
|
||||||
Minor: 0,
|
|
||||||
Micro: 4,
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in a new issue