mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 03:38:42 -07:00
Support clustername change on reload, fixes #1492
Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
@@ -1762,6 +1762,31 @@ func TestConfigReloadClusterNoAdvertise(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestConfigReloadClusterName(t *testing.T) {
|
||||
s, _, conf := runReloadServerWithContent(t, []byte(`
|
||||
listen: "0.0.0.0:-1"
|
||||
cluster: {
|
||||
name: "abc"
|
||||
listen: "0.0.0.0:-1"
|
||||
}
|
||||
`))
|
||||
defer os.Remove(conf)
|
||||
defer s.Shutdown()
|
||||
|
||||
// Update config with a new cluster name.
|
||||
reloadUpdateConfig(t, s, conf, `
|
||||
listen: "0.0.0.0:-1"
|
||||
cluster: {
|
||||
name: "xyz"
|
||||
listen: "0.0.0.0:-1"
|
||||
}
|
||||
`)
|
||||
|
||||
if s.ClusterName() != "xyz" {
|
||||
t.Fatalf("Expected update clustername of \"xyz\", got %q", s.ClusterName())
|
||||
}
|
||||
}
|
||||
|
||||
func TestConfigReloadMaxSubsUnsupported(t *testing.T) {
|
||||
s, _, conf := runReloadServerWithContent(t, []byte(`max_subs: 1`))
|
||||
defer os.Remove(conf)
|
||||
|
||||
Reference in New Issue
Block a user