Browse Source

Removes reap config option.

pull/2380/head
James Phillips 8 years ago
parent
commit
95d418d7da
No known key found for this signature in database
GPG Key ID: 77183E682AC5FC11
  1. 10
      command/agent/config.go
  2. 22
      command/agent/config_test.go

10
command/agent/config.go

@ -577,12 +577,6 @@ type Config struct {
// Minimum Session TTL
SessionTTLMin time.Duration `mapstructure:"-"`
SessionTTLMinRaw string `mapstructure:"session_ttl_min"`
// Reap controls automatic reaping of child processes, useful if running
// as PID 1 in a Docker container. This defaults to nil which will make
// Consul reap only if it detects it's running as PID 1. If non-nil,
// then this will be used to decide if reaping is enabled.
Reap *bool `mapstructure:"reap"`
}
// Bool is used to initialize bool pointers in struct literals.
@ -1477,10 +1471,6 @@ func MergeConfig(a, b *Config) *Config {
result.RetryJoinWan = append(result.RetryJoinWan, a.RetryJoinWan...)
result.RetryJoinWan = append(result.RetryJoinWan, b.RetryJoinWan...)
if b.Reap != nil {
result.Reap = b.Reap
}
return &result
}

22
command/agent/config_test.go

@ -929,27 +929,6 @@ func TestDecodeConfig(t *testing.T) {
if config.SessionTTLMin != 5*time.Second {
t.Fatalf("bad: %s %#v", config.SessionTTLMin.String(), config)
}
// Reap
input = `{"reap": true}`
config, err = DecodeConfig(bytes.NewReader([]byte(input)))
if err != nil {
t.Fatalf("err: %s", err)
}
if config.Reap == nil || *config.Reap != true {
t.Fatalf("bad: reap not enabled: %#v", config)
}
input = `{}`
config, err = DecodeConfig(bytes.NewReader([]byte(input)))
if err != nil {
t.Fatalf("err: %s", err)
}
if config.Reap != nil {
t.Fatalf("bad: reap not tri-stated: %#v", config)
}
}
func TestDecodeConfig_invalidKeys(t *testing.T) {
@ -1523,7 +1502,6 @@ func TestMergeConfig(t *testing.T) {
RPC: &net.TCPAddr{},
RPCRaw: "127.0.0.5:1233",
},
Reap: Bool(true),
}
c := MergeConfig(a, b)

Loading…
Cancel
Save