MCPcopy
hub / github.com/containerd/containerd / Controller

Interface Controller

core/sandbox/controller.go:95–117  ·  view source on GitHub ↗

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.

Source from the content-addressed store, hash-verified

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.
95type 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
119type ControllerInstance struct {
120 SandboxID string

Callers 67

CreateMethod · 0.65
CreateMethod · 0.65
startDaemonFunction · 0.65
StartMethod · 0.65
supportsIDMapFunction · 0.65
NewBinaryProcessorFunction · 0.65
NewBinaryProcessorFunction · 0.65
PlatformMethod · 0.65
PlatformMethod · 0.65
StopMethod · 0.65
startDaemonFunction · 0.65
WaitMethod · 0.65

Implementers 8

remoteSandboxControllercore/sandbox/proxy/controller.go
fakeSandboxControllerinternal/cri/server/service_test.go
Controllerinternal/cri/server/podsandbox/control
ttrpccontrollerClientapi/services/sandbox/v1/sandbox_ttrpc.
controllerClientapi/services/sandbox/v1/sandbox_grpc.p
UnimplementedControllerServerapi/services/sandbox/v1/sandbox_grpc.p
controllerLocalplugins/sandbox/controller.go
stubControllerplugins/services/sandbox/controller_se

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…