When running single-server mode, use public_cluster_addr if given (#904)

When running single-server mode, use public_cluster_addr if given

Right now you don't need to specify a controller address and we use the
cluster listener address; this allows overriding it to the
public_cluster_addr if one is given.

If `controllers` is specified we allow it to be either the cluster
listener or the public cluster address if one is specified before trying
to parse and use it.
pull/953/head
Jeff Mitchell 5 years ago committed by GitHub
parent 3a3b664efb
commit 61ec5b47e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -4,6 +4,12 @@ Canonical reference for changes, improvements, and bugfixes for Boundary.
## Next
### New and Improved
* server: When running single-server mode and `controllers` is not specified in
the `worker` block, use `public_cluster_addr` if given
([PR](https://github.com/hashicorp/boundary/pull/904))
### Bug Fixes
* api: Fix nil pointer panic that could occur when using TLS

@ -229,11 +229,18 @@ func (c *Command) Run(args []string) int {
if c.Config.Controller != nil {
switch len(c.Config.Worker.Controllers) {
case 0:
if c.Config.Controller.PublicClusterAddr != "" {
clusterAddr = c.Config.Controller.PublicClusterAddr
}
c.Config.Worker.Controllers = []string{clusterAddr}
case 1:
if c.Config.Worker.Controllers[0] == clusterAddr {
break
}
if c.Config.Controller.PublicClusterAddr != "" &&
c.Config.Worker.Controllers[0] == c.Config.Controller.PublicClusterAddr {
break
}
// Best effort see if it's a domain name and if not assume it must match
host, _, err := net.SplitHostPort(c.Config.Worker.Controllers[0])
if err != nil && strings.Contains(err.Error(), "missing port in address") {

Loading…
Cancel
Save