mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-02 19:47:54 +00:00
Advertise the cluster_(id|name) in the Scada handshake (#1906)
This commit is contained in:
committed by
Jeff Mitchell
parent
0358a4b161
commit
d5038f34b0
@@ -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"],
|
||||
|
||||
Reference in New Issue
Block a user