Browse code

Merge pull request #9180 from chenchun/master

Clean config path of bind mount volume

Michael Crosby authored on 2014/11/20 10:41:46
Showing 1 changed files
... ...
@@ -166,9 +166,6 @@ func (r *Repository) Delete(path string) error {
166 166
 		return fmt.Errorf("Volume %s does not exist", path)
167 167
 	}
168 168
 
169
-	if volume.IsBindMount {
170
-		return fmt.Errorf("Volume %s is a bind-mount and cannot be removed", volume.Path)
171
-	}
172 169
 	containers := volume.Containers()
173 170
 	if len(containers) > 0 {
174 171
 		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 {
178 178
 		return err
179 179
 	}
180 180
 
181
+	if volume.IsBindMount {
182
+		return nil
183
+	}
184
+
181 185
 	if err := r.driver.Remove(volume.ID); err != nil {
182 186
 		if !os.IsNotExist(err) {
183 187
 			return err