mirror of
https://github.com/hashicorp/vault.git
synced 2026-06-03 22:02:19 -04:00
Advertise the cluster_(id|name) in the Scada handshake (#1906)
This commit is contained in:
parent
0358a4b161
commit
d5038f34b0
2 changed files with 11 additions and 1 deletions
|
|
@ -376,6 +376,15 @@ func (c *ServerCommand) Run(args []string) int {
|
|||
// Initialize the listeners
|
||||
lns := make([]net.Listener, 0, len(config.Listeners))
|
||||
for i, lnConfig := range config.Listeners {
|
||||
if lnConfig.Type == "atlas" {
|
||||
if config.ClusterName == "" {
|
||||
c.Ui.Error("cluster_name is not set in the config and is a required value")
|
||||
return 1
|
||||
}
|
||||
|
||||
lnConfig.Config["cluster_name"] = config.ClusterName
|
||||
}
|
||||
|
||||
ln, props, reloadFunc, err := server.NewListener(lnConfig.Type, lnConfig.Config, logGate)
|
||||
if err != nil {
|
||||
c.Ui.Error(fmt.Sprintf(
|
||||
|
|
|
|||
|
|
@ -32,7 +32,8 @@ func atlasListenerFactory(config map[string]string, logger io.Writer) (net.Liste
|
|||
Version: version.GetVersion().VersionNumber(),
|
||||
ResourceType: "vault-cluster",
|
||||
Meta: map[string]string{
|
||||
"node_id": config["node_id"],
|
||||
"node_id": config["node_id"],
|
||||
"cluster_name": config["cluster_name"],
|
||||
},
|
||||
Atlas: scada.AtlasConfig{
|
||||
Endpoint: config["endpoint"],
|
||||
|
|
|
|||
Loading…
Reference in a new issue