Skip to content

Commit

Permalink
Merging GC related config values
Browse files Browse the repository at this point in the history
  • Loading branch information
diptanu committed Feb 2, 2017
1 parent d06448c commit 9d44247
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions command/agent/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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...)
Expand Down
3 changes: 3 additions & 0 deletions command/agent/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 9d44247

Please sign in to comment.