예제 #1
0
func (d *shimDriver) Get(req volumeplugin.Request) volumeplugin.Response {
	var res volumeplugin.Response
	v, err := d.d.Get(req.Name)
	if err != nil {
		res.Err = err.Error()
		return res
	}
	res.Volume = &volumeplugin.Volume{
		Name:       v.Name(),
		Mountpoint: v.Path(),
	}
	return res
}
예제 #2
0
func (d *kvfsDriver) Get(req volume.Request) volume.Response {
	var res volume.Response
	d.Lock()
	defer d.Unlock()
	v, exists := d.volumes[req.Name]
	if !exists {
		return resp(fmt.Errorf("no such volume"))
	}
	res.Volume = &volume.Volume{
		Name:       v.name,
		Mountpoint: v.mountPoint,
	}
	return res
}
예제 #3
0
func (l *lvmDriver) Get(req volume.Request) volume.Response {
	l.mu.RLock()
	defer l.mu.RUnlock()
	v, exists := l.volumes[req.Name]
	if !exists {
		return resp(fmt.Errorf("no such volume"))
	}
	var res volume.Response
	res.Volume = &volume.Volume{
		Name:       v.Name,
		Mountpoint: v.MountPoint,
	}
	return res
}