mirror of
https://github.com/containers/podman.git
synced 2025-12-01 10:38:05 +08:00
Add support for pids-limit annotation for podman kube play.
This commit adds new annotation called: io.podman.annotations.pids-limit/$ctrname This annotation is used to define the PIDsLimit for a particular pod. It is also automatically defined when newly added --pids-limit option is used. Fixes: #24418 Signed-off-by: Jan Kaluza <jkaluza@redhat.com>
This commit is contained in:
@@ -6180,4 +6180,18 @@ spec:
|
||||
Expect(execArr[len(execArr)-1]).To(Not(ContainSubstring(arr[len(arr)-1])))
|
||||
})
|
||||
|
||||
It("test pids-limit annotation", func() {
|
||||
ctrAnnotation := "io.podman.annotations.pids-limit/" + defaultCtrName
|
||||
pod := getPod(withAnnotation(ctrAnnotation, "10"), withPodInitCtr(getCtr(withImage(CITEST_IMAGE), withCmd([]string{"printenv", "container"}), withInitCtr(), withName("init-test"))), withCtr(getCtr(withImage(CITEST_IMAGE), withCmd([]string{"top"}))))
|
||||
err := generateKubeYaml("pod", pod, kubeYaml)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
|
||||
kube := podmanTest.Podman([]string{"kube", "play", kubeYaml})
|
||||
kube.WaitWithDefaultTimeout()
|
||||
Expect(kube).Should(ExitCleanly())
|
||||
|
||||
exec := podmanTest.PodmanExitCleanly("exec", "testPod-"+defaultCtrName, "cat", "/sys/fs/cgroup/pids.max")
|
||||
Expect(exec.OutputToString()).To(Equal("10"))
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user