(ctx context.Context, dockerCLI command.Cli, services []swarm.Service)
| 103 | } |
| 104 | |
| 105 | func removeServices(ctx context.Context, dockerCLI command.Cli, services []swarm.Service) bool { |
| 106 | var hasError bool |
| 107 | sort.Slice(services, sortServiceByName(services)) |
| 108 | for _, service := range services { |
| 109 | _, _ = fmt.Fprintln(dockerCLI.Out(), "Removing service", service.Spec.Name) |
| 110 | if _, err := dockerCLI.Client().ServiceRemove(ctx, service.ID, client.ServiceRemoveOptions{}); err != nil { |
| 111 | hasError = true |
| 112 | _, _ = fmt.Fprintf(dockerCLI.Err(), "Failed to remove service %s: %s", service.ID, err) |
| 113 | } |
| 114 | } |
| 115 | return hasError |
| 116 | } |
| 117 | |
| 118 | func removeNetworks(ctx context.Context, dockerCLI command.Cli, networks []network.Summary) bool { |
| 119 | var hasError bool |
no test coverage detected
searching dependent graphs…