(ctx context.Context, dockerCli command.Cli, opts inspectOptions)
| 86 | } |
| 87 | |
| 88 | func runInspect(ctx context.Context, dockerCli command.Cli, opts inspectOptions) error { |
| 89 | var elementSearcher inspect.GetRefFunc |
| 90 | switch opts.objectType { |
| 91 | case "", typeConfig, typeContainer, typeImage, typeNetwork, typeNode, |
| 92 | typePlugin, typeSecret, typeService, typeTask, typeVolume: |
| 93 | elementSearcher = inspectAll(ctx, dockerCli, opts.size, opts.objectType) |
| 94 | default: |
| 95 | return fmt.Errorf(`unknown type: %q: must be one of "%s"`, opts.objectType, strings.Join(allTypes, `", "`)) |
| 96 | } |
| 97 | return inspect.Inspect(dockerCli.Out(), opts.ids, opts.format, elementSearcher) |
| 98 | } |
| 99 | |
| 100 | func inspectContainers(ctx context.Context, dockerCli command.Cli, getSize bool) inspect.GetRefFunc { |
| 101 | return func(ref string) (any, []byte, error) { |
no test coverage detected
searching dependent graphs…