Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change ClientAddr to default to BindAddr when not present. #2786

Merged
merged 2 commits into from
Mar 6, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
6 changes: 6 additions & 0 deletions command/agent/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,12 @@ func (c *Command) readConfig() *Config {
}
}

// If the client address is empty, default to using the value specified by the
// bind address.
if config.ClientAddr == "" {
config.ClientAddr = config.BindAddr
}

// Ensure all endpoints are unique
if err := config.verifyUniqueListeners(); err != nil {
c.Ui.Error(fmt.Sprintf("All listening endpoints must be unique: %s", err))
Expand Down
1 change: 0 additions & 1 deletion command/agent/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,6 @@ func DefaultConfig() *Config {
Datacenter: consul.DefaultDC,
Domain: "consul.",
LogLevel: "INFO",
ClientAddr: "127.0.0.1",
BindAddr: "0.0.0.0",
Ports: PortConfig{
DNS: 8600,
Expand Down
13 changes: 9 additions & 4 deletions website/source/docs/agent/options.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,9 @@ will exit with an error at startup.
[`-bind` command-line flag](#_bind), and if this is not specified, the `-bind` option is used. This is available in Consul 0.7.1 and later.

* <a name="_client"></a><a href="#_client">`-client`</a> - The address to which
Consul will bind client interfaces, including the HTTP and DNS servers. By default,
this is "127.0.0.1", allowing only loopback connections.
Consul will bind client interfaces, including the HTTP and DNS servers. When
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you qualify these with "in Consul 0.8 or later this is X, and previously it was Y".

not specified, the default value is the same as
the [`_bind` command-line flag](#_bind) address.

* <a name="_config_file"></a><a href="#_config_file">`-config-file`</a> - A configuration file
to load. For more information on
Expand Down Expand Up @@ -586,8 +587,12 @@ Consul will not enable TLS for the HTTP API unless the `https` port has been ass
reduce write pressure. If a check ever changes state, the new state and associated
output is synchronized immediately. To disable this behavior, set the value to "0s".

* <a name="client_addr"></a><a href="#client_addr">`client_addr`</a> Equivalent to the
[`-client` command-line flag](#_client).
* <a name="client_addr"></a><a href="#client_addr">`client_addr`</a> Equivalent
to the [`-client` command-line flag](#_client). When not specified, the
default value is the same as the [`bind_addr`](#bind_addr) address. It is not
normally necessary to specify this value, however, may be necessary in more
complex setups where agents are NATed or when an agent is running in client
and server mode (common in development).

* <a name="datacenter"></a><a href="#datacenter">`datacenter`</a> Equivalent to the
[`-datacenter` command-line flag](#_datacenter).
Expand Down