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

Method Start

plugins/sandbox/controller.go:174–199  ·  view source on GitHub ↗
(ctx context.Context, sandboxID string)

Source from the content-addressed store, hash-verified

172}
173
174func (c *controllerLocal) Start(ctx context.Context, sandboxID string) (sandbox.ControllerInstance, error) {
175 shim, err := c.shims.Get(ctx, sandboxID)
176 if err != nil {
177 return sandbox.ControllerInstance{}, fmt.Errorf("unable to find sandbox %q", sandboxID)
178 }
179
180 svc, err := sandbox.NewClient(shim.Client())
181 if err != nil {
182 return sandbox.ControllerInstance{}, err
183 }
184
185 resp, err := svc.StartSandbox(ctx, &runtimeAPI.StartSandboxRequest{SandboxID: sandboxID})
186 if err != nil {
187 c.cleanupShim(ctx, sandboxID, svc)
188 return sandbox.ControllerInstance{}, fmt.Errorf("failed to start sandbox %s: %w", sandboxID, errgrpc.ToNative(err))
189 }
190 address, version := shim.Endpoint()
191 return sandbox.ControllerInstance{
192 SandboxID: sandboxID,
193 Pid: resp.GetPid(),
194 Address: address,
195 Version: uint32(version),
196 CreatedAt: resp.GetCreatedAt().AsTime(),
197 Spec: resp.GetSpec(),
198 }, nil
199}
200
201func (c *controllerLocal) Platform(ctx context.Context, sandboxID string) (imagespec.Platform, error) {
202 svc, err := c.getSandbox(ctx, sandboxID)

Callers

nothing calls this directly

Calls 9

cleanupShimMethod · 0.95
NewClientFunction · 0.92
GetMethod · 0.65
ClientMethod · 0.65
StartSandboxMethod · 0.65
EndpointMethod · 0.65
GetPidMethod · 0.65
GetCreatedAtMethod · 0.45
GetSpecMethod · 0.45

Tested by

no test coverage detected