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

Function WithRuntime

client/container_opts.go:60–78  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

58// WithRuntime allows a user to specify the runtime name and additional options that should
59// be used to create tasks for the container
60func 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.

Callers 8

TestRegressionIssue4769Function · 0.85
TestRegressionIssue6429Function · 0.85
TestDaemonRuntimeRootFunction · 0.85
TestIssue9103Function · 0.85
TestIssue10589Function · 0.85

Calls 1

MarshalAnyMethod · 0.65

Tested by 8

TestRegressionIssue4769Function · 0.68
TestRegressionIssue6429Function · 0.68
TestDaemonRuntimeRootFunction · 0.68
TestIssue9103Function · 0.68
TestIssue10589Function · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…