Add new GetServerVersion rpc method

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
This commit is contained in:
Kenfe-Mickael Laventure 2016-05-09 11:38:28 -07:00
parent 3062918899
commit ba465c17a7
4 changed files with 304 additions and 218 deletions

View file

@ -13,6 +13,7 @@ import (
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"github.com/docker/containerd"
"github.com/docker/containerd/api/grpc/types"
"github.com/docker/containerd/runtime"
"github.com/docker/containerd/specs"
@ -33,6 +34,15 @@ func NewServer(sv *supervisor.Supervisor) types.APIServer {
}
}
func (s *apiServer) GetServerVersion(ctx context.Context, c *types.GetServerVersionRequest) (*types.GetServerVersionResponse, error) {
return &types.GetServerVersionResponse{
Major: containerd.VersionMajor,
Minor: containerd.VersionMinor,
Patch: containerd.VersionPatch,
Revision: containerd.GitCommit,
}, nil
}
func (s *apiServer) CreateContainer(ctx context.Context, c *types.CreateContainerRequest) (*types.CreateContainerResponse, error) {
if c.BundlePath == "" {
return nil, errors.New("empty bundle path")