Controller is an interface to manage sandboxes at runtime. When running in sandbox mode, shim expected to implement `SandboxService`. Shim lifetimes are now managed manually via sandbox API by the containerd's client.
| 93 | // When running in sandbox mode, shim expected to implement `SandboxService`. |
| 94 | // Shim lifetimes are now managed manually via sandbox API by the containerd's client. |
| 95 | type Controller interface { |
| 96 | // Create is used to initialize sandbox environment. (mounts, any) |
| 97 | Create(ctx context.Context, sandboxInfo Sandbox, opts ...CreateOpt) error |
| 98 | // Start will start previously created sandbox. |
| 99 | Start(ctx context.Context, sandboxID string) (ControllerInstance, error) |
| 100 | // Platform returns target sandbox OS that will be used by Controller. |
| 101 | // containerd will rely on this to generate proper OCI spec. |
| 102 | Platform(_ctx context.Context, _sandboxID string) (imagespec.Platform, error) |
| 103 | // Stop will stop sandbox instance |
| 104 | Stop(ctx context.Context, sandboxID string, opts ...StopOpt) error |
| 105 | // Wait blocks until sandbox process exits. |
| 106 | Wait(ctx context.Context, sandboxID string) (ExitStatus, error) |
| 107 | // Status will query sandbox process status. It is heavier than Ping call and must be used whenever you need to |
| 108 | // gather metadata about current sandbox state (status, uptime, resource use, etc). |
| 109 | Status(ctx context.Context, sandboxID string, verbose bool) (ControllerStatus, error) |
| 110 | // Shutdown deletes and cleans all tasks and sandbox instance. |
| 111 | Shutdown(ctx context.Context, sandboxID string) error |
| 112 | // Metrics queries the sandbox for metrics. |
| 113 | Metrics(ctx context.Context, sandboxID string) (*types.Metric, error) |
| 114 | // Update changes a part of sandbox, such as extensions/annotations/labels/spec of |
| 115 | // Sandbox object, controllers may have to update the running sandbox according to the changes. |
| 116 | Update(ctx context.Context, sandboxID string, sandbox Sandbox, fields ...string) error |
| 117 | } |
| 118 | |
| 119 | type ControllerInstance struct { |
| 120 | SandboxID string |
no outgoing calls
no test coverage detected
searching dependent graphs…