From f4acfeebda431239c98e07ed8c0d55422e165d4e Mon Sep 17 00:00:00 2001 From: Chun Chen Date: Wed, 19 Nov 2014 10:13:10 +0800 Subject: [PATCH] Clean config path of bind mount volume Signed-off-by: Chun Chen --- volumes/repository.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/volumes/repository.go b/volumes/repository.go index d6612e7a34..225148b60e 100644 --- a/volumes/repository.go +++ b/volumes/repository.go @@ -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