diff options
author | Giuseppe Scrivano <gscrivan@redhat.com> | 2019-12-17 15:05:02 +0100 |
---|---|---|
committer | Giuseppe Scrivano <gscrivan@redhat.com> | 2019-12-17 15:07:43 +0100 |
commit | b7e656690662cf431902b71ea009dd0e0a625bae (patch) | |
tree | 114592643bfa683f9dee3fee0371e21f3a34dff8 | |
parent | 1e440a3a3f7c7a1ac5896ae834e884c0dc3907f3 (diff) | |
download | podman-b7e656690662cf431902b71ea009dd0e0a625bae.tar.gz podman-b7e656690662cf431902b71ea009dd0e0a625bae.tar.bz2 podman-b7e656690662cf431902b71ea009dd0e0a625bae.zip |
libpod: drop arbitrary memory limit of 4M
drop the arbitrary limit of 4M for creating a container.
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
-rw-r--r-- | cmd/podman/shared/create_cli.go | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/cmd/podman/shared/create_cli.go b/cmd/podman/shared/create_cli.go index 08a40b206..00b83906d 100644 --- a/cmd/podman/shared/create_cli.go +++ b/cmd/podman/shared/create_cli.go @@ -12,11 +12,6 @@ import ( "github.com/sirupsen/logrus" ) -const ( - // It's not kernel limit, we want this 4M limit to supply a reasonable functional container - linuxMinMemory = 4194304 -) - // GetAllLabels ... func GetAllLabels(labelFile, inputLabels []string) (map[string]string, error) { labels := make(map[string]string) @@ -86,9 +81,6 @@ func verifyContainerResources(config *cc.CreateConfig, update bool) ([]string, e sysInfo := sysinfo.New(true) // memory subsystem checks and adjustments - if config.Resources.Memory != 0 && config.Resources.Memory < linuxMinMemory { - return warnings, fmt.Errorf("minimum memory limit allowed is 4MB") - } if config.Resources.Memory > 0 && !sysInfo.MemoryLimit { warnings = addWarning(warnings, "Your kernel does not support memory limit capabilities or the cgroup is not mounted. Limitation discarded.") config.Resources.Memory = 0 @@ -120,9 +112,6 @@ func verifyContainerResources(config *cc.CreateConfig, update bool) ([]string, e warnings = addWarning(warnings, "Your kernel does not support memory soft limit capabilities or the cgroup is not mounted. Limitation discarded.") config.Resources.MemoryReservation = 0 } - if config.Resources.MemoryReservation > 0 && config.Resources.MemoryReservation < linuxMinMemory { - return warnings, fmt.Errorf("minimum memory reservation allowed is 4MB") - } if config.Resources.Memory > 0 && config.Resources.MemoryReservation > 0 && config.Resources.Memory < config.Resources.MemoryReservation { return warnings, fmt.Errorf("minimum memory limit cannot be less than memory reservation limit, see usage") } @@ -130,9 +119,6 @@ func verifyContainerResources(config *cc.CreateConfig, update bool) ([]string, e warnings = addWarning(warnings, "Your kernel does not support kernel memory limit capabilities or the cgroup is not mounted. Limitation discarded.") config.Resources.KernelMemory = 0 } - if config.Resources.KernelMemory > 0 && config.Resources.KernelMemory < linuxMinMemory { - return warnings, fmt.Errorf("minimum kernel memory limit allowed is 4MB") - } if config.Resources.DisableOomKiller && !sysInfo.OomKillDisable { // only produce warnings if the setting wasn't to *disable* the OOM Kill; no point // warning the caller if they already wanted the feature to be off |