Merge pull request #2163 from hashicorp/irindos-clusterid-upstreams

feat(worker): Map cluster ID in config to upstream address
This commit is contained in:
Irena Rindos authored and GitHub committed 2022-06-10 10:17:51 -04:00
commit f7dbf2a532
4 files changed
+45 -9

No files matched your search

+9
View File
@@ -32,6 +32,7 @@ import (
"github.com/hashicorp/go-secure-stdlib/mlock"
"github.com/hashicorp/go-secure-stdlib/parseutil"
"github.com/hashicorp/go-secure-stdlib/pluginutil/v2"
"github.com/hashicorp/go-uuid"
"github.com/mitchellh/cli"
"github.com/posener/complete"
"go.uber.org/atomic"
@@ -330,6 +331,14 @@ func (c *Command) Run(args []string) int {
}
}
}
if c.Config.HCPBClusterId != "" {
_, err := uuid.ParseUUID(c.Config.HCPBClusterId)
if err != nil {
c.UI.Error(fmt.Errorf("Invalid HCPB cluster id %q: %w", c.Config.HCPBClusterId, err).Error())
return base.CommandUserError
}
}
}
if err := c.SetupListeners(c.UI, c.Config.SharedConfig, []string{"api", "cluster", "proxy", "ops"}); err != nil {
c.UI.Error(err.Error())
+3
View File
@@ -124,6 +124,9 @@ type Config struct {
// Plugin-related options
Plugins Plugins `hcl:"plugins"`
// Internal field for use with HCP deployments. Used if controllers/ initial_upstreams is not set
HCPBClusterId string `hcl:"hcp_boundary_cluster_id"`
}
type Controller struct {