Dockerd won't start if a network with the default subnet prefix already exists in HNS.
@@ -33,7 +33,6 @@ import (
const (
isWindows = true
- defaultNetworkSpace = "172.16.0.0/12"
platformSupported = true
windowsMinCPUShares = 1
windowsMaxCPUShares = 10000
@@ -424,15 +423,19 @@ func initBridgeDriver(controller libnetwork.NetworkController, config *config.Co
winlibnetwork.NetworkName: runconfig.DefaultDaemonNetworkMode().NetworkName(),
}
- subnetPrefix := defaultNetworkSpace
+ var ipamOption libnetwork.NetworkOption
+ var subnetPrefix string
+
if config.BridgeConfig.FixedCIDR != "" {
subnetPrefix = config.BridgeConfig.FixedCIDR
}
+ if subnetPrefix != "" {
ipamV4Conf := libnetwork.IpamConf{PreferredPool: subnetPrefix}
v4Conf := []*libnetwork.IpamConf{&ipamV4Conf}
v6Conf := []*libnetwork.IpamConf{}
- ipamOption := libnetwork.NetworkOptionIpam("default", "", v4Conf, v6Conf, nil)
+ ipamOption = libnetwork.NetworkOptionIpam("default", "", v4Conf, v6Conf, nil)
+ }
_, err := controller.NewNetwork(string(runconfig.DefaultDaemonNetworkMode()), runconfig.DefaultDaemonNetworkMode().NetworkName(), "",
libnetwork.NetworkOptionGeneric(options.Generic{
