1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #17524 from mountkin/fix-teardown

dont try to remove builtin networks in teardown
This commit is contained in:
Brian Goff 2015-10-30 20:59:57 -04:00
commit cccb6bce7d

View file

@ -598,7 +598,9 @@ func deleteAllNetworks() error {
} }
var errors []string var errors []string
for _, n := range networks { for _, n := range networks {
if n.Name != "bridge" { if n.Name == "bridge" || n.Name == "none" || n.Name == "host" {
continue
}
status, b, err := sockRequest("DELETE", "/networks/"+n.Name, nil) status, b, err := sockRequest("DELETE", "/networks/"+n.Name, nil)
if err != nil { if err != nil {
errors = append(errors, err.Error()) errors = append(errors, err.Error())
@ -608,7 +610,6 @@ func deleteAllNetworks() error {
errors = append(errors, fmt.Sprintf("error deleting network %s: %s", n.Name, string(b))) errors = append(errors, fmt.Sprintf("error deleting network %s: %s", n.Name, string(b)))
} }
} }
}
if len(errors) > 0 { if len(errors) > 0 {
return fmt.Errorf(strings.Join(errors, "\n")) return fmt.Errorf(strings.Join(errors, "\n"))
} }