diff --git a/environment/settings.go b/environment/settings.go index 3b715f59..77d7c3e7 100644 --- a/environment/settings.go +++ b/environment/settings.go @@ -56,7 +56,7 @@ type Limits struct { // Sets which CPU threads can be used by the docker instance. Threads string `json:"threads"` - OOMDisabled bool `json:"oom_disabled"` + OOMKiller bool `json:"oom_killer"` } // ConvertedCpuLimit converts the CPU limit for a server build into a number @@ -99,6 +99,11 @@ func (l Limits) ProcessLimit() int64 { return config.Get().Docker.ContainerPidLimit } +// Helper function to create a pointer to a boolean value +func boolPtr(b bool) *bool { + return &b +} + // AsContainerResources returns the available resources for a container in a format // that Docker understands. func (l Limits) AsContainerResources() container.Resources { @@ -108,7 +113,7 @@ func (l Limits) AsContainerResources() container.Resources { MemoryReservation: l.MemoryLimit * 1_000_000, MemorySwap: l.ConvertedSwap(), BlkioWeight: l.IoWeight, - OomKillDisable: &l.OOMDisabled, + OomKillDisable: boolPtr(!l.OOMKiller), PidsLimit: &pids, }