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

Function runList

cli/command/stack/list.go:41–59  ·  view source on GitHub ↗

runList performs a stack list against the specified swarm cluster

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

Source from the content-addressed store, hash-verified

39
40// runList performs a stack list against the specified swarm cluster
41func runList(ctx context.Context, dockerCLI command.Cli, opts listOptions) error {
42 stacks, err := getStacks(ctx, dockerCLI.Client())
43 if err != nil {
44 return err
45 }
46
47 format := formatter.Format(opts.format)
48 if format == "" || format == formatter.TableFormatKey {
49 format = stackTableFormat
50 }
51 stackCtx := formatter.Context{
52 Output: dockerCLI.Out(),
53 Format: format,
54 }
55 sort.Slice(stacks, func(i, j int) bool {
56 return sortorder.NaturalLess(stacks[i].Name, stacks[j].Name)
57 })
58 return stackWrite(stackCtx, stacks)
59}

Callers 1

newListCommandFunction · 0.70

Calls 4

getStacksFunction · 0.85
stackWriteFunction · 0.85
ClientMethod · 0.65
OutMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…