mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Clean config path of bind mount volume
Signed-off-by: Chun Chen <chenchun.feed@gmail.com>
This commit is contained in:
parent
af54dc215f
commit
f4acfeebda
1 changed files with 4 additions and 3 deletions
|
@ -166,9 +166,6 @@ func (r *Repository) Delete(path string) error {
|
|||
return fmt.Errorf("Volume %s does not exist", path)
|
||||
}
|
||||
|
||||
if volume.IsBindMount {
|
||||
return fmt.Errorf("Volume %s is a bind-mount and cannot be removed", volume.Path)
|
||||
}
|
||||
containers := volume.Containers()
|
||||
if len(containers) > 0 {
|
||||
return fmt.Errorf("Volume %s is being used and cannot be removed: used by containers %s", volume.Path, containers)
|
||||
|
@ -178,6 +175,10 @@ func (r *Repository) Delete(path string) error {
|
|||
return err
|
||||
}
|
||||
|
||||
if volume.IsBindMount {
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := r.driver.Remove(volume.ID); err != nil {
|
||||
if !os.IsNotExist(err) {
|
||||
return err
|
||||
|
|
Loading…
Reference in a new issue