Update sandbox API to return target platform

Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
This commit is contained in:
Maksym Pavlenko
2023-01-08 14:22:19 -08:00
parent dd22a3a806
commit f318e5630b
12 changed files with 1026 additions and 557 deletions

View File

@@ -20,6 +20,7 @@ import (
"context"
"github.com/containerd/containerd/api/services/sandbox/v1"
"github.com/containerd/containerd/api/types"
)
// Controller is an interface to manage sandboxes at runtime.
@@ -30,6 +31,9 @@ type Controller interface {
Create(ctx context.Context, sandboxID string) error
// Start will start previously created sandbox.
Start(ctx context.Context, sandboxID string) (*sandbox.ControllerStartResponse, error)
// Platform returns target sandbox OS that will be used by Controller.
// containerd will rely on this to generate proper OCI spec.
Platform(_ctx context.Context, _sandboxID string) (*types.Platform, error)
// Stop will stop sandbox instance
Stop(ctx context.Context, sandboxID string) (*sandbox.ControllerStopResponse, error)
// Wait blocks until sandbox process exits.