mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
dont try to remove builtin networks in teardown
Signed-off-by: Shijiang Wei <mountkin@gmail.com>
This commit is contained in:
parent
1795eb9545
commit
5970e94072
1 changed files with 10 additions and 9 deletions
|
@ -598,15 +598,16 @@ func deleteAllNetworks() error {
|
|||
}
|
||||
var errors []string
|
||||
for _, n := range networks {
|
||||
if n.Name != "bridge" {
|
||||
status, b, err := sockRequest("DELETE", "/networks/"+n.Name, nil)
|
||||
if err != nil {
|
||||
errors = append(errors, err.Error())
|
||||
continue
|
||||
}
|
||||
if status != http.StatusNoContent {
|
||||
errors = append(errors, fmt.Sprintf("error deleting network %s: %s", n.Name, string(b)))
|
||||
}
|
||||
if n.Name == "bridge" || n.Name == "none" || n.Name == "host" {
|
||||
continue
|
||||
}
|
||||
status, b, err := sockRequest("DELETE", "/networks/"+n.Name, nil)
|
||||
if err != nil {
|
||||
errors = append(errors, err.Error())
|
||||
continue
|
||||
}
|
||||
if status != http.StatusNoContent {
|
||||
errors = append(errors, fmt.Sprintf("error deleting network %s: %s", n.Name, string(b)))
|
||||
}
|
||||
}
|
||||
if len(errors) > 0 {
|
||||
|
|
Loading…
Reference in a new issue