Merge pull request #8747 from Iceber/shim_ttrpc_service

shim: change ttrpcService and ttrpcServerOptioner to exported interfaces
This commit is contained in:
Maksym Pavlenko
2023-07-18 17:12:22 -07:00
committed by GitHub
5 changed files with 21 additions and 10 deletions

View File

@@ -25,6 +25,7 @@ import (
"github.com/containerd/containerd/api/types"
"github.com/containerd/containerd/log"
"github.com/containerd/containerd/pkg/shutdown"
"github.com/containerd/containerd/runtime/v2/shim"
"github.com/containerd/ttrpc"
api "github.com/containerd/containerd/api/runtime/sandbox/v1"
@@ -51,13 +52,16 @@ func init() {
})
}
var (
_ = shim.TTRPCService(&pauseService{})
_ = api.TTRPCSandboxService(&pauseService{})
)
// pauseService is an extension for task v2 runtime to support Pod "pause" containers via sandbox API.
type pauseService struct {
shutdown shutdown.Service
}
var _ api.TTRPCSandboxService = (*pauseService)(nil)
func (p *pauseService) RegisterTTRPC(server *ttrpc.Server) error {
api.RegisterTTRPCSandboxService(server, p)
return nil

View File

@@ -53,7 +53,7 @@ import (
)
var (
_ = (taskAPI.TaskService)(&service{})
_ = shim.TTRPCService(&service{})
empty = &ptypes.Empty{}
)