summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-12-23 10:56:08 +0100
committerGitHub <noreply@github.com>2021-12-23 10:56:08 +0100
commit1b9a5964dbb25f8c3cf2b530ffba52325cc81678 (patch)
tree5924ab4eea975a03b78c3df8b8a3746b4c6a0e66 /pkg
parentc8d42d93933188b256f57f44660e6041b0d872cd (diff)
parenta5e49d9668f430d8b7a8b1619fb2bf6c9087fed7 (diff)
downloadpodman-1b9a5964dbb25f8c3cf2b530ffba52325cc81678.tar.gz
podman-1b9a5964dbb25f8c3cf2b530ffba52325cc81678.tar.bz2
podman-1b9a5964dbb25f8c3cf2b530ffba52325cc81678.zip
Merge pull request #12599 from rhatdan/kernelmemory
Warn on use of --kernel-memory
Diffstat (limited to 'pkg')
-rw-r--r--pkg/api/handlers/compat/info.go1
-rw-r--r--pkg/domain/entities/pods.go1
-rw-r--r--pkg/specgen/generate/validate.go4
-rw-r--r--pkg/specgenutil/specgen.go8
4 files changed, 0 insertions, 14 deletions
diff --git a/pkg/api/handlers/compat/info.go b/pkg/api/handlers/compat/info.go
index 941718a8b..777009f0a 100644
--- a/pkg/api/handlers/compat/info.go
+++ b/pkg/api/handlers/compat/info.go
@@ -84,7 +84,6 @@ func GetInfo(w http.ResponseWriter, r *http.Request) {
InitBinary: "",
InitCommit: docker.Commit{},
Isolation: "",
- KernelMemory: sysInfo.KernelMemory,
KernelMemoryTCP: false,
KernelVersion: infoData.Host.Kernel,
Labels: nil,
diff --git a/pkg/domain/entities/pods.go b/pkg/domain/entities/pods.go
index 14127e468..5c5fa0cb3 100644
--- a/pkg/domain/entities/pods.go
+++ b/pkg/domain/entities/pods.go
@@ -195,7 +195,6 @@ type ContainerCreateOptions struct {
InitPath string
Interactive bool
IPC string
- KernelMemory string
Label []string
LabelFile []string
LogDriver string
diff --git a/pkg/specgen/generate/validate.go b/pkg/specgen/generate/validate.go
index a44bf9979..c74db7325 100644
--- a/pkg/specgen/generate/validate.go
+++ b/pkg/specgen/generate/validate.go
@@ -60,10 +60,6 @@ func verifyContainerResourcesCgroupV1(s *specgen.SpecGenerator) ([]string, error
if memory.Limit != nil && memory.Reservation != nil && *memory.Limit < *memory.Reservation {
return warnings, errors.New("minimum memory limit cannot be less than memory reservation limit, see usage")
}
- if memory.Kernel != nil && !sysInfo.KernelMemory {
- warnings = append(warnings, "Your kernel does not support kernel memory limit capabilities or the cgroup is not mounted. Limitation discarded.")
- memory.Kernel = nil
- }
if memory.DisableOOMKiller != nil && *memory.DisableOOMKiller && !sysInfo.OomKillDisable {
warnings = append(warnings, "Your kernel does not support OomKillDisable. OomKillDisable discarded.")
memory.DisableOOMKiller = nil
diff --git a/pkg/specgenutil/specgen.go b/pkg/specgenutil/specgen.go
index 9a91b2893..be8f277cc 100644
--- a/pkg/specgenutil/specgen.go
+++ b/pkg/specgenutil/specgen.go
@@ -163,14 +163,6 @@ func getMemoryLimits(s *specgen.SpecGenerator, c *entities.ContainerCreateOption
hasLimits = true
}
}
- if m := c.KernelMemory; len(m) > 0 {
- mk, err := units.RAMInBytes(m)
- if err != nil {
- return nil, errors.Wrapf(err, "invalid value for kernel-memory")
- }
- memory.Kernel = &mk
- hasLimits = true
- }
if c.MemorySwappiness >= 0 {
swappiness := uint64(c.MemorySwappiness)
memory.Swappiness = &swappiness