code: func pruneServices(ctx context.Context, dockerCli command.Cli, namespace convert.Namespace, services map[string]struct{}) {
  	client := dockerCli.Client()
  
  	oldServices, err := getStackServices(ctx, client, namespace.Name())
  	if err != nil {
  		fmt.Fprintf(dockerCli.Err(), "Failed to list services: %s\n", err)
  	}
  
  	pruneServices := []swarm.Service{}
  	for _, service := range oldServices {
  		if _, exists := services[namespace.Descope(service.Spec.Name)]; !exists {
  			pruneServices = append(pruneServices, service)
  		}
  	}
  	removeServices(ctx, dockerCli, pruneServices)
  }
docs: // pruneServices removes services that are no longer referenced in the source