From 95d418d7da0832b4b7358de8a54fadf4444c104f Mon Sep 17 00:00:00 2001 From: James Phillips Date: Thu, 6 Oct 2016 21:43:48 -0700 Subject: [PATCH] Removes reap config option. --- command/agent/config.go | 10 ---------- command/agent/config_test.go | 22 ---------------------- 2 files changed, 32 deletions(-) diff --git a/command/agent/config.go b/command/agent/config.go index d9dd79edf6..921949e874 100644 --- a/command/agent/config.go +++ b/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 } diff --git a/command/agent/config_test.go b/command/agent/config_test.go index 27b733ee3c..f0aaa2cf02 100644 --- a/command/agent/config_test.go +++ b/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)