MCPcopy Create free account
hub / github.com/containerd/nerdctl / Unpause

Function Unpause

pkg/cmd/container/unpause.go:32–49  ·  view source on GitHub ↗

Unpause unpauses all containers specified by `reqs`.

(ctx context.Context, client *containerd.Client, reqs []string, options types.ContainerUnpauseOptions)

Source from the content-addressed store, hash-verified

30
31// Unpause unpauses all containers specified by `reqs`.
32func Unpause(ctx context.Context, client *containerd.Client, reqs []string, options types.ContainerUnpauseOptions) error {
33 walker := &containerwalker.ContainerWalker{
34 Client: client,
35 OnFound: func(ctx context.Context, found containerwalker.Found) error {
36 if found.MatchCount > 1 {
37 return fmt.Errorf("multiple IDs found with provided prefix: %s", found.Req)
38 }
39 if err := containerutil.Unpause(ctx, client, found.Container.ID(), (*config.Config)(&options.GOptions), options.NerdctlCmd, options.NerdctlArgs); err != nil {
40 return err
41 }
42
43 _, err := fmt.Fprintln(options.Stdout, found.Req)
44 return err
45 },
46 }
47
48 return walker.WalkAll(ctx, reqs, true)
49}

Callers 1

unpauseActionFunction · 0.92

Calls 2

WalkAllMethod · 0.95
UnpauseFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…