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

Function runServices

cli/command/stack/services.go:52–63  ·  view source on GitHub ↗

runServices performs a stack services against the specified swarm cluster

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

Source from the content-addressed store, hash-verified

50
51// runServices performs a stack services against the specified swarm cluster
52func runServices(ctx context.Context, dockerCLI command.Cli, opts serviceListOptions) error {
53 res, err := dockerCLI.Client().ServiceList(ctx, client.ServiceListOptions{
54 Filters: getStackFilterFromOpt(opts.namespace, opts.filter),
55 // When not running "quiet", also get service status (number of running
56 // and desired tasks).
57 Status: !opts.quiet,
58 })
59 if err != nil {
60 return err
61 }
62 return formatWrite(dockerCLI, res, opts)
63}
64
65func formatWrite(dockerCLI command.Cli, services client.ServiceListResult, opts serviceListOptions) error {
66 // if no services in the stack, print message and exit 0

Callers 1

newServicesCommandFunction · 0.85

Calls 4

getStackFilterFromOptFunction · 0.85
formatWriteFunction · 0.70
ClientMethod · 0.65
ServiceListMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…