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

Function removeServices

cli/command/stack/remove.go:105–116  ·  view source on GitHub ↗
(ctx context.Context, dockerCLI command.Cli, services []swarm.Service)

Source from the content-addressed store, hash-verified

103}
104
105func 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
118func removeNetworks(ctx context.Context, dockerCLI command.Cli, networks []network.Summary) bool {
119 var hasError bool

Callers 2

runRemoveFunction · 0.85
pruneServicesFunction · 0.85

Calls 5

sortServiceByNameFunction · 0.85
ServiceRemoveMethod · 0.80
OutMethod · 0.65
ClientMethod · 0.65
ErrMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…