MCPcopy
hub / github.com/containerd/containerd / Wait

Method Wait

plugins/sandbox/controller.go:267–285  ·  view source on GitHub ↗
(ctx context.Context, sandboxID string)

Source from the content-addressed store, hash-verified

265}
266
267func (c *controllerLocal) Wait(ctx context.Context, sandboxID string) (sandbox.ExitStatus, error) {
268 svc, err := c.getSandbox(ctx, sandboxID)
269 if err != nil {
270 return sandbox.ExitStatus{}, err
271 }
272
273 resp, err := svc.WaitSandbox(ctx, &runtimeAPI.WaitSandboxRequest{
274 SandboxID: sandboxID,
275 })
276
277 if err != nil {
278 return sandbox.ExitStatus{}, fmt.Errorf("failed to wait sandbox %s: %w", sandboxID, errgrpc.ToNative(err))
279 }
280
281 return sandbox.ExitStatus{
282 ExitStatus: resp.GetExitStatus(),
283 ExitedAt: resp.GetExitedAt().AsTime(),
284 }, nil
285}
286
287func (c *controllerLocal) Status(ctx context.Context, sandboxID string, verbose bool) (sandbox.ControllerStatus, error) {
288 svc, err := c.getSandbox(ctx, sandboxID)

Callers

nothing calls this directly

Calls 4

getSandboxMethod · 0.95
WaitSandboxMethod · 0.65
GetExitStatusMethod · 0.45
GetExitedAtMethod · 0.45

Tested by

no test coverage detected