diff --git a/daemon/daemon_windows.go b/daemon/daemon_windows.go index fafe2fd29e372..94c7c49b0b28d 100644 --- a/daemon/daemon_windows.go +++ b/daemon/daemon_windows.go @@ -337,6 +337,7 @@ func (daemon *Daemon) initNetworkController(daemonCfg *config.Config, activeSand }) drvOptions := make(map[string]string) + var labels map[string]string nid := "" if n != nil { nid = n.ID() @@ -351,6 +352,7 @@ func (daemon *Daemon) initNetworkController(daemonCfg *config.Config, activeSand // restore option if it existed before drvOptions = n.DriverOptions() + labels = n.Labels() n.Delete() } netOption := map[string]string{ @@ -388,6 +390,7 @@ func (daemon *Daemon) initNetworkController(daemonCfg *config.Config, activeSand netlabel.GenericData: netOption, }), libnetwork.NetworkOptionIpam("default", "", v4Conf, v6Conf, nil), + libnetwork.NetworkOptionLabels(labels), ) if err != nil { log.G(context.TODO()).Errorf("Error occurred when creating network %v", err)