|
|
|
|
@ -17,6 +17,7 @@ import (
|
|
|
|
|
pbs "github.com/hashicorp/boundary/internal/gen/controller/servers/services"
|
|
|
|
|
"github.com/hashicorp/boundary/internal/server"
|
|
|
|
|
"github.com/hashicorp/boundary/version"
|
|
|
|
|
"github.com/hashicorp/go-secure-stdlib/parseutil"
|
|
|
|
|
"github.com/hashicorp/go-secure-stdlib/strutil"
|
|
|
|
|
"google.golang.org/grpc/connectivity"
|
|
|
|
|
)
|
|
|
|
|
@ -249,8 +250,13 @@ func (w *Worker) sendWorkerStatus(cancelCtx context.Context, sessionManager sess
|
|
|
|
|
if len(w.conf.RawConfig.Worker.InitialUpstreams) > 0 {
|
|
|
|
|
addrs = append(addrs, w.conf.RawConfig.Worker.InitialUpstreams...)
|
|
|
|
|
} else if HandleHcpbClusterId != nil && len(w.conf.RawConfig.HcpbClusterId) > 0 {
|
|
|
|
|
clusterAddress := HandleHcpbClusterId(w.conf.RawConfig.HcpbClusterId)
|
|
|
|
|
addrs = append(addrs, clusterAddress)
|
|
|
|
|
clusterId, err := parseutil.ParsePath(w.conf.RawConfig.HcpbClusterId)
|
|
|
|
|
if err != nil && !errors.Is(err, parseutil.ErrNotAUrl) {
|
|
|
|
|
event.WriteError(cancelCtx, op, err, event.WithInfoMsg("failed to parse HCP Boundary cluster ID"))
|
|
|
|
|
} else {
|
|
|
|
|
clusterAddress := HandleHcpbClusterId(clusterId)
|
|
|
|
|
addrs = append(addrs, clusterAddress)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
addrs = strutil.RemoveDuplicates(addrs, false)
|
|
|
|
|
|