Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions drivers/windows/labels.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,7 @@ const (

// DisableDNS label
DisableDNS = "com.docker.network.windowsshim.disable_dns"

// DisableGatewayDNS label
DisableGatewayDNS = "com.docker.network.windowsshim.disable_gatewaydns"
)
14 changes: 14 additions & 0 deletions drivers/windows/windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ type networkConfiguration struct {
NetworkAdapterName string
dbIndex uint64
dbExists bool
DisableGatewayDNS bool
}

// endpointConfiguration represents the user specified configuration for the sandbox endpoint
Expand Down Expand Up @@ -177,6 +178,12 @@ func (d *driver) parseNetworkOptions(id string, genericOptions map[string]string
config.DNSSuffix = value
case DNSServers:
config.DNSServers = value
case DisableGatewayDNS:
b, err := strconv.ParseBool(value)
if err != nil {
return nil, err
}
config.DisableGatewayDNS = b
case MacPool:
config.MacPools = make([]hcsshim.MacPool, 0)
s := strings.Split(value, ",")
Expand Down Expand Up @@ -589,7 +596,14 @@ func (d *driver) CreateEndpoint(nid, eid string, ifInfo driverapi.InterfaceInfo,

endpointStruct.DNSServerList = strings.Join(epOption.DNSServers, ",")

// overwrite the ep DisableDNS option if DisableGatewayDNS was set to true during the network creation option
if n.config.DisableGatewayDNS {
logrus.Debugf("n.config.DisableGatewayDNS[%v] overwrites epOption.DisableDNS[%v]", n.config.DisableGatewayDNS, epOption.DisableDNS)
epOption.DisableDNS = n.config.DisableGatewayDNS
}

if n.driver.name == "nat" && !epOption.DisableDNS {
logrus.Debugf("endpointStruct.EnableInternalDNS =[%v]", endpointStruct.EnableInternalDNS)
endpointStruct.EnableInternalDNS = true
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/windows/windows_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (d *driver) populateNetworks() error {
if err = d.createNetwork(ncfg); err != nil {
logrus.Warnf("could not create windows network for id %s hnsid %s while booting up from persistent state: %v", ncfg.ID, ncfg.HnsID, err)
}
logrus.Debugf("Network (%s) restored", ncfg.ID[0:7])
logrus.Debugf("Network %v (%s) restored", d.name, ncfg.ID[0:7])
}

return nil
Expand Down