MCPcopy Index your code
hub / github.com/containerd/containerd / WithTaskAPIEndpoint

Function WithTaskAPIEndpoint

client/task_opts.go:55–69  ·  view source on GitHub ↗

WithTaskAPIEndpoint allow task service to manage a task through a given endpoint, usually it is served inside a sandbox, and we can get it from sandbox status.

(address string, version uint32)

Source from the content-addressed store, hash-verified

53// WithTaskAPIEndpoint allow task service to manage a task through a given endpoint,
54// usually it is served inside a sandbox, and we can get it from sandbox status.
55func WithTaskAPIEndpoint(address string, version uint32) NewTaskOpts {
56 return func(ctx context.Context, client *Client, info *TaskInfo) error {
57 info.taskAPIAddress = address
58 info.taskAPIVersion = version
59 // Also populate the deprecated runc options fields so this keeps
60 // working against older containerd servers that only read the task
61 // API endpoint from runc options. Non-runc runtimes never supported
62 // these fields, so an error here is ignored.
63 if opts, err := info.getRuncOptions(); err == nil {
64 opts.TaskApiAddress = address //nolint:staticcheck // deprecated, kept for backward compatibility
65 opts.TaskApiVersion = version //nolint:staticcheck // deprecated, kept for backward compatibility
66 }
67 return nil
68 }
69}
70
71// WithTaskCheckpoint allows a task to be created with live runtime and memory data from a
72// previous checkpoint. Additional software such as CRIU may be required to

Callers

nothing calls this directly

Calls 1

getRuncOptionsMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…