WithRuntime allows a user to specify the runtime name and additional options that should be used to create tasks for the container
(name string, options any)
| 58 | // WithRuntime allows a user to specify the runtime name and additional options that should |
| 59 | // be used to create tasks for the container |
| 60 | func WithRuntime(name string, options any) NewContainerOpts { |
| 61 | return func(ctx context.Context, client *Client, c *containers.Container) error { |
| 62 | var ( |
| 63 | opts typeurl.Any |
| 64 | err error |
| 65 | ) |
| 66 | if options != nil { |
| 67 | opts, err = typeurl.MarshalAny(options) |
| 68 | if err != nil { |
| 69 | return err |
| 70 | } |
| 71 | } |
| 72 | c.Runtime = containers.RuntimeInfo{ |
| 73 | Name: name, |
| 74 | Options: opts, |
| 75 | } |
| 76 | return nil |
| 77 | } |
| 78 | } |
| 79 | |
| 80 | // WithSandbox joins the container to a container group (aka sandbox) from the given ID |
| 81 | // Note: shim runtime must support sandboxes environments. |
searching dependent graphs…