mirror of https://github.com/status-im/consul.git
agent: don't reload scada client if there is no config change
This commit is contained in:
parent
ed70720d55
commit
4b715a7d2c
|
@ -906,10 +906,13 @@ func (c *Command) handleReload(config *Config) *Config {
|
||||||
}(wp)
|
}(wp)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reload SCADA client
|
// Reload SCADA client if we have a change
|
||||||
if err := c.setupScadaConn(newConf); err != nil {
|
if newConf.AtlasInfrastructure != config.AtlasInfrastructure ||
|
||||||
c.Ui.Error(fmt.Sprintf("Failed reloading SCADA client: %s", err))
|
newConf.AtlasToken != config.AtlasToken {
|
||||||
return nil
|
if err := c.setupScadaConn(newConf); err != nil {
|
||||||
|
c.Ui.Error(fmt.Sprintf("Failed reloading SCADA client: %s", err))
|
||||||
|
return nil
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return newConf
|
return newConf
|
||||||
|
|
|
@ -284,7 +284,7 @@ func TestSetupScadaConn(t *testing.T) {
|
||||||
t.Fatalf("err: %s", err)
|
t.Fatalf("err: %s", err)
|
||||||
}
|
}
|
||||||
if cmd.scadaHttp == http1 || cmd.scadaProvider == provider1 {
|
if cmd.scadaHttp == http1 || cmd.scadaProvider == provider1 {
|
||||||
t.Fatalf("bad: %#v", cmd)
|
t.Fatalf("should change: %#v %#v", cmd.scadaHttp, cmd.scadaProvider)
|
||||||
}
|
}
|
||||||
list = cmd.scadaHttp.listener.(*scadaListener)
|
list = cmd.scadaHttp.listener.(*scadaListener)
|
||||||
if list == nil || list.addr.infra != "hashicorp/test2" {
|
if list == nil || list.addr.infra != "hashicorp/test2" {
|
||||||
|
|
Loading…
Reference in New Issue