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)
| 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. |
| 55 | func 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 |
nothing calls this directly
no test coverage detected
searching dependent graphs…