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:
commit
cccb6bce7d
1 changed files with 10 additions and 9 deletions
|
@ -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"))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue