From d0fe4a67a538e4856c5b13e72cea56fd14e283f3 Mon Sep 17 00:00:00 2001 From: Diptanu Choudhury Date: Wed, 1 Feb 2017 15:58:21 -0800 Subject: [PATCH] Merging GC related config values --- CHANGELOG.md | 1 + command/agent/config.go | 9 +++++++++ command/agent/config_test.go | 3 +++ 3 files changed, 13 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c90ab48bd..49872d317 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ IMPROVEMENTS: * core: Update Serf and Memberlist for more reliable gossip [GH-2255] + * client: Apply GC related configurations properly [GH-2273] * client: Reproducible Node ID on OSes that provide system-level UUID [GH-2277] * server/vault: Vault Client on Server handles SIGHUP to reload configs diff --git a/command/agent/config.go b/command/agent/config.go index c7e107525..f842662f1 100644 --- a/command/agent/config.go +++ b/command/agent/config.go @@ -901,6 +901,15 @@ func (a *ClientConfig) Merge(b *ClientConfig) *ClientConfig { if b.Reserved != nil { result.Reserved = result.Reserved.Merge(b.Reserved) } + if b.GCInterval != 0 { + result.GCInterval = b.GCInterval + } + if b.GCDiskUsageThreshold != 0 { + result.GCDiskUsageThreshold = b.GCDiskUsageThreshold + } + if b.GCInodeUsageThreshold != 0 { + result.GCInodeUsageThreshold = b.GCInodeUsageThreshold + } // Add the servers result.Servers = append(result.Servers, b.Servers...) diff --git a/command/agent/config_test.go b/command/agent/config_test.go index 6697139ff..35d90f8b5 100644 --- a/command/agent/config_test.go +++ b/command/agent/config_test.go @@ -197,6 +197,9 @@ func TestConfig_Merge(t *testing.T) { ReservedPorts: "2,10-30,55", ParsedReservedPorts: []int{1, 2, 3}, }, + GCInterval: 6 * time.Second, + GCDiskUsageThreshold: 71, + GCInodeUsageThreshold: 86, }, Server: &ServerConfig{ Enabled: true,