runServices performs a stack services against the specified swarm cluster
(ctx context.Context, dockerCLI command.Cli, opts serviceListOptions)
| 50 | |
| 51 | // runServices performs a stack services against the specified swarm cluster |
| 52 | func 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 | |
| 65 | func formatWrite(dockerCLI command.Cli, services client.ServiceListResult, opts serviceListOptions) error { |
| 66 | // if no services in the stack, print message and exit 0 |
no test coverage detected
searching dependent graphs…