mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
Don't set up DNS in Network.createEndpoint
DNS is set up when the endpoint is joined to a network. It was added in commit4850c5f(Avoid duplicate entries in /etc/hosts) then simplified inbcca214(libnetwork: open-code updating svc records) and seems to be related to setting up a name on a swarm node that isn't running the container with the endpoint. But, all callers of Network.createEndpoint follow up with an Endpoint.Join, which also sets up the DNS entry. Those callers are: Network.createLoadBalancerSandbox Network.CreateEndpoint - called by Daemon.connectToNetwork - called by Sandbox.setupDefaultGateway - called by builder-net/executor.go: iface.init None of them bail out before the Join for a Swarm case. So, it looks like enough has changed that the createEndpoint code is no longer needed (it predates the internal DNS server) ... remove it. Signed-off-by: Rob Murray <rob.murray@docker.com>
This commit is contained in:
@@ -1268,15 +1268,6 @@ func (n *Network) createEndpoint(ctx context.Context, name string, options ...En
|
||||
}
|
||||
}()
|
||||
|
||||
if !n.getController().isSwarmNode() || n.Scope() != scope.Swarm || !n.driverIsMultihost() {
|
||||
n.updateSvcRecord(context.WithoutCancel(ctx), ep, true)
|
||||
defer func() {
|
||||
if err != nil {
|
||||
n.updateSvcRecord(context.WithoutCancel(ctx), ep, false)
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
||||
return ep, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user