MCPcopy Index your code
hub / github.com/docker/cli / runList

Function runList

cli/command/config/ls.go:48–74  ·  view source on GitHub ↗

runList lists Swarm configs.

(ctx context.Context, dockerCLI command.Cli, options listOptions)

Source from the content-addressed store, hash-verified

46
47// runList lists Swarm configs.
48func runList(ctx context.Context, dockerCLI command.Cli, options listOptions) error {
49 apiClient := dockerCLI.Client()
50
51 res, err := apiClient.ConfigList(ctx, client.ConfigListOptions{Filters: options.filter.Value()})
52 if err != nil {
53 return err
54 }
55
56 format := options.format
57 if len(format) == 0 {
58 if len(dockerCLI.ConfigFile().ConfigFormat) > 0 && !options.quiet {
59 format = dockerCLI.ConfigFile().ConfigFormat
60 } else {
61 format = formatter.TableFormatKey
62 }
63 }
64
65 sort.Slice(res.Items, func(i, j int) bool {
66 return sortorder.NaturalLess(res.Items[i].Spec.Name, res.Items[j].Spec.Name)
67 })
68
69 configCtx := formatter.Context{
70 Output: dockerCLI.Out(),
71 Format: newFormat(format, options.quiet),
72 }
73 return formatWrite(configCtx, res)
74}

Callers 1

newConfigListCommandFunction · 0.70

Calls 7

newFormatFunction · 0.70
formatWriteFunction · 0.70
ClientMethod · 0.65
ValueMethod · 0.65
ConfigFileMethod · 0.65
OutMethod · 0.65
ConfigListMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…