Support HCPBInt in hcpb_cluster_id field (#2880)

* initial commit
This commit is contained in:
Irena Rindos authored and GitHub committed 2023-02-01 13:20:07 -05:00
1 parent 55259029f1
commit a030c15403
3 files changed
+15 -8

No files matched your search

@@ -36,7 +36,7 @@ import (
"google.golang.org/protobuf/types/known/structpb"
)
const hcpbUrlSuffix = ".proxy.boundary.hashicorp.cloud:9202"
var HandleHcpbClusterId func(s string) string
// StartControllerConnections starts up the resolver and initiates controller
// connection client creation
@@ -60,8 +60,8 @@ func (w *Worker) StartControllerConnections() error {
}
if len(initialAddrs) == 0 {
if w.conf.RawConfig.HcpbClusterId != "" {
clusterAddress := fmt.Sprintf("%s%s", w.conf.RawConfig.HcpbClusterId, hcpbUrlSuffix)
if w.conf.RawConfig.HcpbClusterId != "" && HandleHcpbClusterId != nil {
clusterAddress := HandleHcpbClusterId(w.conf.RawConfig.HcpbClusterId)
initialAddrs = append(initialAddrs, clusterAddress)
event.WriteSysEvent(w.baseContext, op, fmt.Sprintf("Setting HCP Boundary cluster address %s as upstream address", clusterAddress))
} else {