Add new GetServerVersion rpc method
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
This commit is contained in:
parent
3062918899
commit
ba465c17a7
4 changed files with 304 additions and 218 deletions
|
@ -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")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue