MCPcopy
hub / github.com/containerd/containerd / Create

Method Create

core/sandbox/proxy/controller.go:47–67  ·  view source on GitHub ↗
(ctx context.Context, sandboxInfo sandbox.Sandbox, opts ...sandbox.CreateOpt)

Source from the content-addressed store, hash-verified

45}
46
47func (s *remoteSandboxController) Create(ctx context.Context, sandboxInfo sandbox.Sandbox, opts ...sandbox.CreateOpt) error {
48 var options sandbox.CreateOptions
49 for _, opt := range opts {
50 opt(&options)
51 }
52 apiSandbox := sandbox.ToProto(&sandboxInfo)
53 _, err := s.client.Create(ctx, &api.ControllerCreateRequest{
54 SandboxID: sandboxInfo.ID,
55 Rootfs: mount.ToProto(options.Rootfs),
56 Options: typeurl.MarshalProto(options.Options),
57 NetnsPath: options.NetNSPath,
58 Annotations: options.Annotations,
59 Sandbox: apiSandbox,
60 Sandboxer: s.sandboxerName,
61 })
62 if err != nil {
63 return errgrpc.ToNative(err)
64 }
65
66 return nil
67}
68
69func (s *remoteSandboxController) Start(ctx context.Context, sandboxID string) (sandbox.ControllerInstance, error) {
70 resp, err := s.client.Start(ctx, &api.ControllerStartRequest{

Callers

nothing calls this directly

Calls 3

ToProtoFunction · 0.92
ToProtoFunction · 0.92
CreateMethod · 0.65

Tested by

no test coverage detected