wire up enable_event_publisher
This commit is contained in:
parent
9a2b1bd63a
commit
559517455a
|
@ -243,6 +243,9 @@ func convertServerConfig(agentConfig *Config) (*nomad.Config, error) {
|
|||
if agentConfig.Server.UpgradeVersion != "" {
|
||||
conf.UpgradeVersion = agentConfig.Server.UpgradeVersion
|
||||
}
|
||||
if agentConfig.Server.EnableEventPublisher {
|
||||
conf.EnableEventPublisher = agentConfig.Server.EnableEventPublisher
|
||||
}
|
||||
if agentConfig.Autopilot != nil {
|
||||
if agentConfig.Autopilot.CleanupDeadServers != nil {
|
||||
conf.AutopilotConfig.CleanupDeadServers = *agentConfig.Autopilot.CleanupDeadServers
|
||||
|
|
|
@ -57,6 +57,8 @@ func TestAgent_ServerConfig(t *testing.T) {
|
|||
out, err := a.serverConfig()
|
||||
require.NoError(t, err)
|
||||
|
||||
require.True(t, out.EnableEventPublisher)
|
||||
|
||||
serfAddr := out.SerfConfig.MemberlistConfig.AdvertiseAddr
|
||||
require.Equal(t, "127.0.0.1", serfAddr)
|
||||
|
||||
|
|
|
@ -94,6 +94,7 @@ func (c *Command) readConfig() *Config {
|
|||
flags.Var((*flaghelper.StringFlag)(&cmdConfig.Server.ServerJoin.StartJoin), "join", "")
|
||||
flags.Var((*flaghelper.StringFlag)(&cmdConfig.Server.ServerJoin.RetryJoin), "retry-join", "")
|
||||
flags.IntVar(&cmdConfig.Server.ServerJoin.RetryMaxAttempts, "retry-max", 0, "")
|
||||
flags.BoolVar(&cmdConfig.Server.EnableEventPublisher, "event-publisher", false, "")
|
||||
flags.Var((flaghelper.FuncDurationVar)(func(d time.Duration) error {
|
||||
cmdConfig.Server.ServerJoin.RetryInterval = d
|
||||
return nil
|
||||
|
|
|
@ -484,6 +484,10 @@ type ServerConfig struct {
|
|||
// This value is ignored.
|
||||
DefaultSchedulerConfig *structs.SchedulerConfiguration `hcl:"default_scheduler_config"`
|
||||
|
||||
// EnableEventPublisher configures whether this server's state store
|
||||
// will generate events for its event stream.
|
||||
EnableEventPublisher bool `hcl:"enable_event_publisher"`
|
||||
|
||||
// ExtraKeysHCL is used by hcl to surface unexpected keys
|
||||
ExtraKeysHCL []string `hcl:",unusedKeys" json:"-"`
|
||||
}
|
||||
|
@ -874,8 +878,9 @@ func DefaultConfig() *Config {
|
|||
BindWildcardDefaultHostNetwork: true,
|
||||
},
|
||||
Server: &ServerConfig{
|
||||
Enabled: false,
|
||||
StartJoin: []string{},
|
||||
Enabled: false,
|
||||
EnableEventPublisher: true,
|
||||
StartJoin: []string{},
|
||||
ServerJoin: &ServerJoin{
|
||||
RetryJoin: []string{},
|
||||
RetryInterval: 30 * time.Second,
|
||||
|
@ -1399,6 +1404,10 @@ func (a *ServerConfig) Merge(b *ServerConfig) *ServerConfig {
|
|||
result.ServerJoin = result.ServerJoin.Merge(b.ServerJoin)
|
||||
}
|
||||
|
||||
if b.EnableEventPublisher {
|
||||
result.EnableEventPublisher = true
|
||||
}
|
||||
|
||||
if b.DefaultSchedulerConfig != nil {
|
||||
c := *b.DefaultSchedulerConfig
|
||||
result.DefaultSchedulerConfig = &c
|
||||
|
|
|
@ -122,6 +122,7 @@ var basicConfig = &Config{
|
|||
RedundancyZone: "foo",
|
||||
UpgradeVersion: "0.8.0",
|
||||
EncryptKey: "abc",
|
||||
EnableEventPublisher: true,
|
||||
ServerJoin: &ServerJoin{
|
||||
RetryJoin: []string{"1.1.1.1", "2.2.2.2"},
|
||||
RetryInterval: time.Duration(15) * time.Second,
|
||||
|
|
|
@ -130,6 +130,7 @@ server {
|
|||
upgrade_version = "0.8.0"
|
||||
encrypt = "abc"
|
||||
raft_multiplier = 4
|
||||
enable_event_publisher = true
|
||||
|
||||
server_join {
|
||||
retry_join = ["1.1.1.1", "2.2.2.2"]
|
||||
|
|
|
@ -261,6 +261,7 @@
|
|||
"data_dir": "/tmp/data",
|
||||
"deployment_gc_threshold": "12h",
|
||||
"enabled": true,
|
||||
"enable_event_publisher": true,
|
||||
"enabled_schedulers": [
|
||||
"test"
|
||||
],
|
||||
|
|
Loading…
Reference in New Issue