Merge pull request #47375 from robmry/47370_windows_nat_network_dns

Set up DNS names for Windows default network
This commit is contained in:
Sebastiaan van Stijn 2024-02-13 13:47:28 +01:00 committed by GitHub
commit b8a71a1c44
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -649,7 +649,10 @@ func cleanOperationalData(es *network.EndpointSettings) {
}
func (daemon *Daemon) updateNetworkConfig(container *container.Container, n *libnetwork.Network, endpointConfig *networktypes.EndpointSettings, updateSettings bool) error {
if containertypes.NetworkMode(n.Name()).IsUserDefined() {
// Set up DNS names for a user defined network, and for the default 'nat'
// network on Windows (IsBridge() returns true for nat).
if containertypes.NetworkMode(n.Name()).IsUserDefined() ||
(serviceDiscoveryOnDefaultNetwork() && containertypes.NetworkMode(n.Name()).IsBridge()) {
endpointConfig.DNSNames = buildEndpointDNSNames(container, endpointConfig.Aliases)
}