mirror of
https://github.com/kemko/nomad.git
synced 2026-01-04 09:25:46 +03:00
client: add disk_total_mb and disk_free_mb config options (#15852)
This commit is contained in:
committed by
GitHub
parent
ca847a195f
commit
588392cabc
@@ -668,6 +668,12 @@ func convertClientConfig(agentConfig *Config) (*clientconfig.Config, error) {
|
||||
if agentConfig.Client.MemoryMB != 0 {
|
||||
conf.MemoryMB = agentConfig.Client.MemoryMB
|
||||
}
|
||||
if agentConfig.Client.DiskTotalMB != 0 {
|
||||
conf.DiskTotalMB = agentConfig.Client.DiskTotalMB
|
||||
}
|
||||
if agentConfig.Client.DiskFreeMB != 0 {
|
||||
conf.DiskFreeMB = agentConfig.Client.DiskFreeMB
|
||||
}
|
||||
if agentConfig.Client.MaxKillTimeout != "" {
|
||||
dur, err := time.ParseDuration(agentConfig.Client.MaxKillTimeout)
|
||||
if err != nil {
|
||||
|
||||
@@ -227,6 +227,12 @@ type ClientConfig struct {
|
||||
// MemoryMB is used to override any detected or default total memory.
|
||||
MemoryMB int `hcl:"memory_total_mb"`
|
||||
|
||||
// DiskTotalMB is used to override any detected or default total disk space.
|
||||
DiskTotalMB int `hcl:"disk_total_mb"`
|
||||
|
||||
// DiskFreeMB is used to override any detected or default free disk space.
|
||||
DiskFreeMB int `hcl:"disk_free_mb"`
|
||||
|
||||
// ReservableCores is used to override detected reservable cpu cores.
|
||||
ReserveableCores string `hcl:"reservable_cores"`
|
||||
|
||||
@@ -2006,6 +2012,12 @@ func (a *ClientConfig) Merge(b *ClientConfig) *ClientConfig {
|
||||
if b.MemoryMB != 0 {
|
||||
result.MemoryMB = b.MemoryMB
|
||||
}
|
||||
if b.DiskTotalMB != 0 {
|
||||
result.DiskTotalMB = b.DiskTotalMB
|
||||
}
|
||||
if b.DiskFreeMB != 0 {
|
||||
result.DiskFreeMB = b.DiskFreeMB
|
||||
}
|
||||
if b.MaxKillTimeout != "" {
|
||||
result.MaxKillTimeout = b.MaxKillTimeout
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user