// VolumeRemove removes a volume from the docker host.
421581
func (cli *Client) VolumeRemove(ctx context.Context, volumeID string, force bool) error {
	query := url.Values{}
	if versions.GreaterThanOrEqualTo(cli.version, "1.25") {
		if force {
			query.Set("force", "1")
		}
	}
	resp, err := cli.delete(ctx, "/volumes/"+volumeID, query, nil)
	defer ensureReaderClosed(resp)
	return wrapResponseError(err, resp, "volume", volumeID)
}
811362
func (d *driver) VolumeRemove(
	ctx types.Context,
	volumeID string,
	opts *types.VolumeRemoveOpts) error {

	d.Lock()
	defer d.Unlock()
	if err := d.refreshSession(ctx); err != nil {
		return err
	}

	fields := map[string]interface{}{
		"provider": vbox.Name,
		"volumeID": volumeID,
	}

	err := d.vbox.RemoveMedium(volumeID)
	if err != nil {
		return goof.WithFieldsE(fields, "error deleting volume", err)
	}

	return nil
}
768249
func (c *Client) PlaylistRemove(name string) error {
	return c.Command("rm %s", name).OK()
}
622983
func (v *localVolume) Unmount(id string) error {
	v.m.Lock()
	defer v.m.Unlock()

	// Always decrement the count, even if the unmount fails
	// Essentially docker doesn't care if this fails, it will send an error, but
	// ultimately there's nothing that can be done. If we don't decrement the count
	// this volume can never be removed until a daemon restart occurs.
	if v.opts != nil {
		v.active.count--
	}

	if v.active.count > 0 {
		return nil
	}

	return v.unmount()
}
310816
func (_m *APIClient) VolumeRemove(ctx context.Context, volumeID string, force bool) error {
	ret := _m.Called(ctx, volumeID, force)

	var r0 error
	if rf, ok := ret.Get(0).(func(context.Context, string, bool) error); ok {
		r0 = rf(ctx, volumeID, force)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}
398218
func RunRemove(dockerCli command.Cli, flags *pflag.FlagSet, commonOrchestrator command.Orchestrator, opts options.Remove) error {
	return runOrchestratedCommand(dockerCli, flags, commonOrchestrator,
		func() error { return swarm.RunRemove(dockerCli, opts) },
		func(kli *kubernetes.KubeCli) error { return kubernetes.RunRemove(kli, opts) })
}
643645
func RunRemove(dockerCli command.Cli, opts options.Remove) error {
	client := dockerCli.Client()
	ctx := context.Background()

	var errs []string
	for _, namespace := range opts.Namespaces {
		services, err := getStackServices(ctx, client, namespace)
		if err != nil {
			return err
		}

		networks, err := getStackNetworks(ctx, client, namespace)
		if err != nil {
			return err
		}

		var secrets []swarm.Secret
		if versions.GreaterThanOrEqualTo(client.ClientVersion(), "1.25") {
			secrets, err = getStackSecrets(ctx, client, namespace)
			if err != nil {
				return err
			}
		}

		var configs []swarm.Config
		if versions.GreaterThanOrEqualTo(client.ClientVersion(), "1.30") {
			configs, err = getStackConfigs(ctx, client, namespace)
			if err != nil {
				return err
			}
		}

		if len(services)+len(networks)+len(secrets)+len(configs) == 0 {
			fmt.Fprintf(dockerCli.Err(), "Nothing found in stack: %s\n", namespace)
			continue
		}

		hasError := removeServices(ctx, dockerCli, services)
		hasError = removeSecrets(ctx, dockerCli, secrets) || hasError
		hasError = removeConfigs(ctx, dockerCli, configs) || hasError
		hasError = removeNetworks(ctx, dockerCli, networks) || hasError

		if hasError {
			errs = append(errs, fmt.Sprintf("Failed to remove some resources from stack: %s", namespace))
		}
	}

	if len(errs) > 0 {
		return errors.Errorf(strings.Join(errs, "\n"))
	}
	return nil
}
837545
func RunRemove(dockerCli *KubeCli, opts options.Remove) error {
	composeClient, err := dockerCli.composeClient()
	if err != nil {
		return err
	}
	stacks, err := composeClient.Stacks(false)
	if err != nil {
		return err
	}
	for _, stack := range opts.Namespaces {
		fmt.Fprintf(dockerCli.Out(), "Removing stack: %s\n", stack)
		if err := stacks.Delete(stack); err != nil {
			return errors.Wrapf(err, "Failed to remove stack %s", stack)
		}
	}
	return nil
}
471734
func (m *MockCommonAPIClient) VolumeRemove(ctx context.Context, volumeID string, force bool) error {
	ret := m.ctrl.Call(m, "VolumeRemove", ctx, volumeID, force)
	ret0, _ := ret[0].(error)
	return ret0
}
965430
func (e *Engine) VirtualizationRemove(ctx context.Context, ID string, removeVolumes, force bool) error {
	return e.client.ContainerRemove(ctx, ID, dockertypes.ContainerRemoveOptions{RemoveVolumes: removeVolumes, Force: force})
}
1176320
func (_m *APIClient) ServiceRemove(ctx context.Context, serviceID string) error {
	ret := _m.Called(ctx, serviceID)

	var r0 error
	if rf, ok := ret.Get(0).(func(context.Context, string) error); ok {
		r0 = rf(ctx, serviceID)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}
836528
func (d *driver) Remove(
	ctx types.Context,
	volumeName string,
	opts *types.VolumeRemoveOpts) error {

	if volumeName == "" {
		return goof.New("missing volume name or ID")
	}

	vol, err := d.volumeInspectByIDOrName(
		ctx, "", volumeName, 0, opts.Opts)
	if err != nil {
		return err
	}

	if vol == nil {
		return goof.New("volume not found")
	}

	client := context.MustClient(ctx)

	// check to see if there is a config override for force remove
	if !opts.Force {
		opts.Force = d.volumeRemoveForce()
	}

	return client.Storage().VolumeRemove(ctx, vol.ID, opts)
}
364805
func (util *VsphereDiskUtil) DeleteVolume(vd *vsphereVolumeDeleter) error {
	cloud, err := getCloudProvider(vd.plugin.host.GetCloudProvider())
	if err != nil {
		return err
	}

	if err = cloud.DeleteVolume(vd.volPath); err != nil {
		klog.V(2).Infof("Error deleting vsphere volume %s: %v", vd.volPath, err)
		return err
	}
	klog.V(2).Infof("Successfully deleted vsphere volume %s", vd.volPath)
	return nil
}
579562
func (d *driver) VolumeRemove(
	ctx types.Context,
	volumeID string,
	opts *types.VolumeRemoveOpts) error {

	if d.quotas() {
		ctx.WithField("volume", volumeID).Debug("clearing volume quotas")
		if err := d.client.ClearQuota(ctx, volumeID); err != nil {
			return err
		}
	}

	ctx.WithFields(log.Fields{
		"volume": volumeID,
		"owner":  d.client.API.User(),
	}).Debug("setting volume owner to current user")
	if err := d.client.SetVolumeOwnerToCurrentUser(ctx, volumeID); err != nil {
		return err
	}

	ctx.WithField("volume", volumeID).Debug("force deleting volume")
	if err := d.client.ForceDeleteVolume(ctx, volumeID); err != nil {
		return err
	}

	return nil
}
453341
func (c *ContivClient) VolumeProfileDelete(tenantName string, volumeProfileName string) error {
	// build key and URL
	keyStr := tenantName + ":" + volumeProfileName
	url := c.baseURL + "/api/v1/volumeProfiles/" + keyStr + "/"

	// http get the object
	err := c.httpDelete(url)
	if err != nil {
		log.Debugf("Error deleting volumeProfile %s. Err: %v", keyStr, err)
		return err
	}

	return nil
}
670821
func (ec2i *FakeEC2Impl) DetachVolume(request *ec2.DetachVolumeInput) (resp *ec2.VolumeAttachment, err error) {
	panic("Not implemented")
}
803729
func (k *SimpleFS) SimpleFSRemove(ctx context.Context,
	arg keybase1.SimpleFSRemoveArg) error {
	return k.startAsync(ctx, arg.OpID, keybase1.AsyncOps_REMOVE,
		keybase1.NewOpDescriptionWithRemove(
			keybase1.RemoveArgs{
				OpID: arg.OpID, Path: arg.Path, Recursive: arg.Recursive,
			}),
		func(ctx context.Context) (err error) {
			return k.doRemove(ctx, arg.Path, arg.Recursive)
		})
}