Merge pull request #149 from thaJeztah/18.09_backport_fix_restart

[18.09 backport] keep old network ids
Upstream-commit: 9dc0488d1c0f424368cf8af56006acc46a846679
Component: engine
This commit is contained in:
Andrew Hsu
2019-02-20 18:03:40 -08:00
committed by GitHub
+4 -2
View File
@@ -343,8 +343,10 @@ func (daemon *Daemon) initNetworkController(config *config.Config, activeSandbox
controller.WalkNetworks(s)
drvOptions := make(map[string]string)
nid := ""
if n != nil {
nid = n.ID()
// global networks should not be deleted by local HNS
if n.Info().Scope() == datastore.GlobalScope {
continue
@@ -389,7 +391,7 @@ func (daemon *Daemon) initNetworkController(config *config.Config, activeSandbox
}
v6Conf := []*libnetwork.IpamConf{}
_, err := controller.NewNetwork(strings.ToLower(v.Type), name, "",
_, err := controller.NewNetwork(strings.ToLower(v.Type), name, nid,
libnetwork.NetworkOptionGeneric(options.Generic{
netlabel.GenericData: netOption,
}),