Add ability to set public cluster address (#761)

This commit is contained in:
Jeff Mitchell authored and GitHub committed 2020-10-30 16:54:53 -04:00
1 parent 038540f9ad
commit e2e4631929
14 files changed
+84 -16

No files matched your search

+15
View File
@@ -48,6 +48,7 @@ type Command struct {
flagTargetSessionConnectionLimit int
flagControllerAPIListenAddr string
flagControllerClusterListenAddr string
flagControllerPublicClusterAddr string
flagWorkerProxyListenAddr string
flagWorkerPublicAddr string
flagPassthroughDirectory string
@@ -163,6 +164,13 @@ func (c *Command) Flags() *base.FlagSets {
Usage: "Address to bind to for controller \"cluster\" purpose. If this begins with a forward slash, it will be assumed to be a Unix domain socket path.",
})
f.StringVar(&base.StringVar{
Name: "controller-public-cluster-address",
Target: &c.flagControllerPublicClusterAddr,
EnvVar: "BOUNDARY_DEV_CONTROLLER_PUBLIC_CLUSTER_ADDRESS",
Usage: "Public address at which the controller is reachable for cluster tasks (like worker connections).",
})
f.StringVar(&base.StringVar{
Name: "proxy-listen-address",
Target: &c.flagWorkerProxyListenAddr,
@@ -356,6 +364,13 @@ func (c *Command) Run(args []string) int {
return 1
}
if err := c.SetupControllerPublicClusterAddress(c.Config, c.flagControllerPublicClusterAddr); err != nil {
c.UI.Error(err.Error())
return 1
}
c.InfoKeys = append(c.InfoKeys, "controller public cluster addr")
c.Info["controller public cluster addr"] = c.Config.Controller.PublicClusterAddr
if err := c.SetupWorkerPublicAddress(c.Config, c.flagWorkerPublicAddr); err != nil {
c.UI.Error(err.Error())
return 1