// Delete removes the storage asset that was created by Provision represented
// by the given PV.
496276
func (p *iscsiProvisioner) Delete(volume *v1.PersistentVolume) error {
	//vol from the annotation
	log.Debugln("volume deletion request received: ", volume.GetName())
	for _, initiator := range strings.Split(volume.Annotations["initiators"], ",") {
		log.Debugln("removing iscsi export: ", volume.Annotations["volume_name"], volume.Annotations["pool"], initiator)
		err := p.exportDestroy(volume.Annotations["volume_name"], volume.Annotations["pool"], initiator)
		if err != nil {
			log.Warnln(err)
			return err
		}
		log.Debugln("iscsi export removed: ", volume.Annotations["volume_name"], volume.Annotations["pool"], initiator)
	}
	log.Debugln("removing logical volume : ", volume.Annotations["volume_name"], volume.Annotations["pool"])
	err := p.volDestroy(volume.Annotations["volume_name"], volume.Annotations["pool"])
	if err != nil {
		log.Warnln(err)
		return err
	}
	log.Debugln("logical volume removed: ", volume.Annotations["volume_name"], volume.Annotations["pool"])
	log.Debugln("volume deletion request completed: ", volume.GetName())
	return nil
}
966295
func Delete(path string, h interface{}, m ...interface{}) {
	Default.Delete(path, h, m...)
}
1015573
func (f *FileStore) Delete(keys [][]byte) error {
	return f.DeleteRange(keys, math.MinInt64, math.MaxInt64)
}
73400
func (ms *manifestStore) Delete(ctx context.Context, dgst digest.Digest) error {
	dcontext.GetLogger(ms.ctx).Debug("(*manifestStore).Delete")
	return ms.blobStore.Delete(ctx, dgst)
}
1204909
func (c *Client) Delete(path string) error {
	return c.Send("DELETE", path, nil, nil)
}
670972
func (s *Service) Delete(ctx context.Context, v interface{}, path string) error {
	return s.Do(ctx, v, "DELETE", path, nil, nil, nil)
}
1141630
func (p *nfsProvisioner) Delete(volume *v1.PersistentVolume) error {
	// Ignore the call if this provisioner was not the one to provision the
	// volume. It doesn't even attempt to delete it, so it's neither a success
	// (nil error) nor failure (any other error)
	provisioned, err := p.provisioned(volume)
	if err != nil {
		return fmt.Errorf("error determining if this provisioner was the one to provision volume %q: %v", volume.Name, err)
	}
	if !provisioned {
		strerr := fmt.Sprintf("this provisioner id %s didn't provision volume %q and so can't delete it; id %s did & can", p.identity, volume.Name, volume.Annotations[annProvisionerID])
		return &controller.IgnoredError{Reason: strerr}
	}

	err = p.deleteDirectory(volume)
	if err != nil {
		return fmt.Errorf("error deleting volume's backing path: %v", err)
	}

	err = p.deleteExport(volume)
	if err != nil {
		return fmt.Errorf("deleted the volume's backing path but error deleting export: %v", err)
	}

	err = p.deleteQuota(volume)
	if err != nil {
		return fmt.Errorf("deleted the volume's backing path & export but error deleting quota: %v", err)
	}

	return nil
}
693650
func (f *NWFilterBinding) Delete() error {
	if C.LIBVIR_VERSION_NUMBER < 4005000 {
		return makeNotImplementedError("virNWFilterBindingDelete")
	}
	var err C.virError
	result := C.virNWFilterBindingDeleteWrapper(f.ptr, &err)
	if result == -1 {
		return makeError(&err)
	}
	return nil
}
1043786
func (dfs *DistributedFilesystem) Delete(snapshotID string) error {
	vol, err := dfs.disk.GetTenant(snapshotID)
	if err != nil {
		return err
	}

	if info, err := vol.SnapshotInfo(snapshotID); err != volume.ErrInvalidSnapshot {
		if err != nil {
			return err
		} else if err := dfs.deleteImages(info.TenantID, info.Label); err != nil {
			return err
		}
	}

	if err := vol.RemoveSnapshot(snapshotID); err != nil {
		glog.Errorf("Could not delete snapshot %s: %s", snapshotID, err)
		return err
	}

	return nil
}
954803
func (s *store) Delete(ctx context.Context, dgst digest.Digest) error {
	if err := os.RemoveAll(s.blobPath(dgst)); err != nil {
		if !os.IsNotExist(err) {
			return err
		}

		return errors.Wrapf(errdefs.ErrNotFound, "content %v", dgst)
	}

	return nil
}
864903
func (c *FakePersistentVolumes) Delete(name string, options *v1.DeleteOptions) error {
	_, err := c.Fake.
		Invokes(testing.NewRootDeleteAction(persistentvolumesResource, name), &corev1.PersistentVolume{})
	return err
}
117810
func (p *openEBSProvisioner) Delete(volume *v1.PersistentVolume) error {

	var openebsVol mApiv1.OpenEBSVolume

	ann, ok := volume.Annotations["openEBSProvisionerIdentity"]
	if !ok {
		return errors.New("identity annotation not found on PV")
	}
	if ann != p.identity {
		return &controller.IgnoredError{Reason: "identity annotation on PV does not match ours"}
	}

	// Issue a delete request to Maya API Server
	err := openebsVol.DeleteVolume(volume.Name)
	if err != nil {
		glog.Errorf("Error while deleting volume: %v", err)
		return err
	}

	return nil
}
187980
func (d *driver) Delete(ctx context.Context, path string) error {
	blobRef := d.client.GetContainerReference(d.container).GetBlobReference(path)
	ok, err := blobRef.DeleteIfExists(nil)
	if err != nil {
		return err
	}
	if ok {
		return nil // was a blob and deleted, return
	}

	// Not a blob, see if path is a virtual container with blobs
	blobs, err := d.listBlobs(d.container, path)
	if err != nil {
		return err
	}

	for _, b := range blobs {
		blobRef = d.client.GetContainerReference(d.container).GetBlobReference(b)
		if err = blobRef.Delete(nil); err != nil {
			return err
		}
	}

	if len(blobs) == 0 {
		return storagedriver.PathNotFoundError{Path: path}
	}
	return nil
}
355006
func (d *Datastore) Delete(k ds.Key) error {
	d.buffer[k] = op{delete: true}
	if len(d.buffer) > d.maxBufferEntries {
		return d.Flush()
	}
	return nil
}
286960
func (l *LocalStore) Delete(ctx context.Context, obj string) error {
	fo := path.Join(l.storepath, obj)
	os.Remove(fo)
	mf := fo + ".metadata"
	if cloudstorage.Exists(mf) {
		os.Remove(mf)
	}
	return nil
}
826158
func (c *CloudStorage) Delete(ctx context.Context, path string) error {
	bh, err := c.bucketHandle(ctx, storage.ScopeReadWrite)
	if err != nil {
		return err
	}
	return bh.Object(path).Delete(ctx)
}
1021502
func (r *Service) Delete(key string) error {
	c := r.pool.Get()
	defer c.Close()

	_, err := c.Do("DEL", r.Config.Prefix+key)
	return err
}