Unpause unpauses all containers specified by `reqs`.
(ctx context.Context, client *containerd.Client, reqs []string, options types.ContainerUnpauseOptions)
| 30 | |
| 31 | // Unpause unpauses all containers specified by `reqs`. |
| 32 | func 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 | } |
no test coverage detected
searching dependent graphs…