Move local sandbox controller under plugins package

Add options to sandbox controller interface.
Update sandbox controller interface to fully utilize sandbox controller
interface.
Move grpc error conversion to service.

Signed-off-by: Derek McGowan <derek@mcg.dev>
This commit is contained in:
Derek McGowan
2023-01-19 00:05:47 -08:00
parent 2717685dad
commit a788f6c799
9 changed files with 384 additions and 269 deletions

View File

@@ -269,7 +269,7 @@ func (c *Controller) Start(ctx context.Context, id string) (cin sandbox.Controll
return
}
func (c *Controller) Create(ctx context.Context, _id string) error {
func (c *Controller) Create(ctx context.Context, _id string, _ ...sandbox.CreateOpt) error {
// Not used by pod-sandbox implementation as there is no need to split pause containers logic.
return nil
}

View File

@@ -29,9 +29,10 @@ import (
sandboxstore "github.com/containerd/containerd/pkg/cri/store/sandbox"
ctrdutil "github.com/containerd/containerd/pkg/cri/util"
"github.com/containerd/containerd/protobuf"
"github.com/containerd/containerd/sandbox"
)
func (c *Controller) Stop(ctx context.Context, sandboxID string) error {
func (c *Controller) Stop(ctx context.Context, sandboxID string, _ ...sandbox.StopOpt) error {
sandbox, err := c.sandboxStore.Get(sandboxID)
if err != nil {
return fmt.Errorf("an error occurred when try to find sandbox %q: %w",