diff options
| author | Aaron Lehmann <aaron.lehmann@docker.com> | 2016-08-31 11:44:32 -0700 |
|---|---|---|
| committer | Victor Vieux <vieux@docker.com> | 2016-09-26 21:02:54 -0700 |
| commit | b6943c50f14324579916f47bb3c7820371faa4c1 (patch) | |
| tree | 1834811768e5d399393b45da18adf8690bd3f2e9 | |
| parent | d5aaaa7ea3ba0601d30be418e9aae681569f260e (diff) | |
| download | docker-cherry-picks-1.12.2.tar.gz | |
cluster: Do not autodetect advertise address on joincherry-picks-1.12.2
On join, remote addresses are supposed to be detected by the manager
that receives the join request. However, the daemon is interfering with
this by automatically detecting an advertise address and specifying that
to the remote manager. Fix this so that an advertise address is only
specified while joining a cluster if one was given by the user.
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
(cherry picked from commit b1d2b088533187954d3b98ed5951ec2dbbb422e9)
Signed-off-by: Victor Vieux <vieux@docker.com>
| -rw-r--r-- | daemon/cluster/cluster.go | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/daemon/cluster/cluster.go b/daemon/cluster/cluster.go index f09c5ee398..04a65f01f4 100644 --- a/daemon/cluster/cluster.go +++ b/daemon/cluster/cluster.go @@ -455,11 +455,13 @@ func (c *Cluster) Join(req types.JoinRequest) error { } var advertiseAddr string - advertiseHost, advertisePort, err := c.resolveAdvertiseAddr(req.AdvertiseAddr, listenPort) - // For joining, we don't need to provide an advertise address, - // since the remote side can detect it. - if err == nil { - advertiseAddr = net.JoinHostPort(advertiseHost, advertisePort) + if req.AdvertiseAddr != "" { + advertiseHost, advertisePort, err := c.resolveAdvertiseAddr(req.AdvertiseAddr, listenPort) + // For joining, we don't need to provide an advertise address, + // since the remote side can detect it. + if err == nil { + advertiseAddr = net.JoinHostPort(advertiseHost, advertisePort) + } } // todo: check current state existing |
