MCPcopy
hub / github.com/containerd/containerd / Containers

Method Containers

client/client.go:326–336  ·  view source on GitHub ↗

Containers returns all containers created in containerd

(ctx context.Context, filters ...string)

Source from the content-addressed store, hash-verified

324
325// Containers returns all containers created in containerd
326func (c *Client) Containers(ctx context.Context, filters ...string) ([]Container, error) {
327 r, err := c.ContainerService().List(ctx, filters...)
328 if err != nil {
329 return nil, err
330 }
331 out := make([]Container, len(r))
332 for i, container := range r {
333 out[i] = containerFromRecord(c, container)
334 }
335 return out, nil
336}
337
338// NewContainer will create a new container with the provided id.
339// The id must be unique within the namespace.

Callers 5

TestContainerListFunction · 0.80
recoverMethod · 0.80
cleanupFunction · 0.80
containers.goFile · 0.80
monitorMethod · 0.80

Calls 3

ContainerServiceMethod · 0.95
containerFromRecordFunction · 0.85
ListMethod · 0.65

Tested by 1

TestContainerListFunction · 0.64