瀏覽代碼

Merge pull request #9180 from chenchun/master

Clean config path of bind mount volume
Michael Crosby 10 年之前
父節點
當前提交
adc344dfde
共有 1 個文件被更改,包括 4 次插入3 次删除
  1. 4 3
      volumes/repository.go

+ 4 - 3
volumes/repository.go

@@ -166,9 +166,6 @@ func (r *Repository) Delete(path string) error {
 		return fmt.Errorf("Volume %s does not exist", path)
 		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()
 	containers := volume.Containers()
 	if len(containers) > 0 {
 	if len(containers) > 0 {
 		return fmt.Errorf("Volume %s is being used and cannot be removed: used by containers %s", volume.Path, containers)
 		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
 		return err
 	}
 	}
 
 
+	if volume.IsBindMount {
+		return nil
+	}
+
 	if err := r.driver.Remove(volume.ID); err != nil {
 	if err := r.driver.Remove(volume.ID); err != nil {
 		if !os.IsNotExist(err) {
 		if !os.IsNotExist(err) {
 			return err
 			return err