Merge pull request #2273 from hashicorp/config-merge

Merging GC related config values
This commit is contained in:
Diptanu Choudhury 2017-02-02 13:40:29 -08:00 committed by GitHub
commit 10b999367a
3 changed files with 13 additions and 0 deletions

View file

@ -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

View file

@ -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...)

View file

@ -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,