Merge pull request #8747 from Iceber/shim_ttrpc_service
shim: change ttrpcService and ttrpcServerOptioner to exported interfaces
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -53,7 +53,7 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
_ = (taskAPI.TaskService)(&service{})
|
||||
_ = shim.TTRPCService(&service{})
|
||||
empty = &ptypes.Empty{}
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user