Advertise the cluster_(id|name) in the Scada handshake (#1906)

This commit is contained in:
Evan Phoenix
2016-09-23 07:55:51 -07:00
committed by Jeff Mitchell
parent 0358a4b161
commit d5038f34b0
2 changed files with 11 additions and 1 deletions

View File

@@ -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(