[sandbox] Cleanup interfaces
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
This commit is contained in:
@@ -32,7 +32,6 @@ import (
|
||||
proto "github.com/containerd/containerd/runtime/v2/task"
|
||||
"github.com/containerd/containerd/sandbox"
|
||||
"github.com/containerd/containerd/services"
|
||||
"github.com/pkg/errors"
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
@@ -165,51 +164,6 @@ func (c *controllerLocal) Wait(ctx context.Context, in *api.ControllerWaitReques
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (c *controllerLocal) Pause(ctx context.Context, in *api.ControllerPauseRequest, opts ...grpc.CallOption) (*api.ControllerPauseResponse, error) {
|
||||
svc, err := c.getSandbox(ctx, in.SandboxID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if _, err := svc.PauseSandbox(ctx, &proto.PauseSandboxRequest{
|
||||
SandboxID: in.SandboxID,
|
||||
}); err != nil {
|
||||
return nil, errors.Wrapf(err, "failed to resume sandbox %s", in.SandboxID)
|
||||
}
|
||||
|
||||
return &api.ControllerPauseResponse{}, nil
|
||||
}
|
||||
|
||||
func (c *controllerLocal) Resume(ctx context.Context, in *api.ControllerResumeRequest, opts ...grpc.CallOption) (*api.ControllerResumeResponse, error) {
|
||||
svc, err := c.getSandbox(ctx, in.SandboxID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if _, err := svc.ResumeSandbox(ctx, &proto.ResumeSandboxRequest{
|
||||
SandboxID: in.SandboxID,
|
||||
}); err != nil {
|
||||
return nil, errors.Wrapf(err, "failed to resume sandbox %s", in.SandboxID)
|
||||
}
|
||||
|
||||
return &api.ControllerResumeResponse{}, nil
|
||||
}
|
||||
|
||||
func (c *controllerLocal) Ping(ctx context.Context, in *api.ControllerPingRequest, opts ...grpc.CallOption) (*api.ControllerPingResponse, error) {
|
||||
svc, err := c.getSandbox(ctx, in.SandboxID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if _, err := svc.PingSandbox(ctx, &proto.PingRequest{
|
||||
SandboxID: in.SandboxID,
|
||||
}); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &api.ControllerPingResponse{}, nil
|
||||
}
|
||||
|
||||
func (c *controllerLocal) Status(ctx context.Context, in *api.ControllerStatusRequest, opts ...grpc.CallOption) (*api.ControllerStatusResponse, error) {
|
||||
svc, err := c.getSandbox(ctx, in.SandboxID)
|
||||
if err != nil {
|
||||
|
||||
@@ -83,20 +83,6 @@ func (s *controllerService) Wait(ctx context.Context, req *api.ControllerWaitReq
|
||||
return s.local.Wait(ctx, req)
|
||||
}
|
||||
|
||||
func (s *controllerService) Pause(ctx context.Context, req *api.ControllerPauseRequest) (*api.ControllerPauseResponse, error) {
|
||||
log.G(ctx).WithField("req", req).Debug("pause sandbox")
|
||||
return s.local.Pause(ctx, req)
|
||||
}
|
||||
|
||||
func (s *controllerService) Resume(ctx context.Context, req *api.ControllerResumeRequest) (*api.ControllerResumeResponse, error) {
|
||||
log.G(ctx).WithField("req", req).Debug("resume sandbox")
|
||||
return s.local.Resume(ctx, req)
|
||||
}
|
||||
|
||||
func (s *controllerService) Ping(ctx context.Context, req *api.ControllerPingRequest) (*api.ControllerPingResponse, error) {
|
||||
return s.local.Ping(ctx, req)
|
||||
}
|
||||
|
||||
func (s *controllerService) Status(ctx context.Context, req *api.ControllerStatusRequest) (*api.ControllerStatusResponse, error) {
|
||||
log.G(ctx).WithField("req", req).Debug("sandbox status")
|
||||
return s.local.Status(ctx, req)
|
||||
|
||||
Reference in New Issue
Block a user