MCPcopy
hub / github.com/containerd/containerd / LoadContainer

Method LoadContainer

client/client.go:380–397  ·  view source on GitHub ↗

LoadContainer loads an existing container from metadata

(ctx context.Context, id string)

Source from the content-addressed store, hash-verified

378
379// LoadContainer loads an existing container from metadata
380func (c *Client) LoadContainer(ctx context.Context, id string) (Container, error) {
381 ctx, span := tracing.StartSpan(ctx, "client.LoadContainer")
382 defer span.End()
383 r, err := c.ContainerService().Get(ctx, id)
384 if err != nil {
385 return nil, err
386 }
387
388 span.SetAttributes(
389 tracing.Attribute("container.id", r.ID),
390 tracing.Attribute("container.image.ref", r.Image),
391 tracing.Attribute("container.runtime.name", r.Runtime.Name),
392 tracing.Attribute("container.snapshotter.name", r.Snapshotter),
393 tracing.Attribute("container.createdAt", r.CreatedAt.Format(time.RFC3339)),
394 tracing.Attribute("container.updatedAt", r.UpdatedAt.Format(time.RFC3339)),
395 )
396 return containerFromRecord(c, r), nil
397}
398
399// RemoteContext is used to configure object resolutions and transfers with
400// remote content stores and image providers.

Callers 15

TestContainerdRestartFunction · 0.80
TestContainerExtensionsFunction · 0.80
TestContainerAttachFunction · 0.80
getSandboxPidCountMethod · 0.80
deleteContainerFunction · 0.80
containers.goFile · 0.80
checkpoint.goFile · 0.80
start.goFile · 0.80
attach.goFile · 0.80
resume.goFile · 0.80

Calls 8

ContainerServiceMethod · 0.95
StartSpanFunction · 0.92
AttributeFunction · 0.92
containerFromRecordFunction · 0.85
EndMethod · 0.80
SetAttributesMethod · 0.80
FormatMethod · 0.80
GetMethod · 0.65