From d19e1526d3c5185b3fd4e3a456d5903c476e5ba3 Mon Sep 17 00:00:00 2001 From: karta0807913 Date: Thu, 1 Dec 2022 02:33:39 +0000 Subject: [PATCH] add friendly comment Signed-off-by: karta0807913 --- test/e2e/config/containers-cgroup.conf | 12 ------------ test/e2e/play_kube_test.go | 14 ++++++++++++-- 2 files changed, 12 insertions(+), 14 deletions(-) delete mode 100644 test/e2e/config/containers-cgroup.conf diff --git a/test/e2e/config/containers-cgroup.conf b/test/e2e/config/containers-cgroup.conf deleted file mode 100644 index 220c1f850c..0000000000 --- a/test/e2e/config/containers-cgroup.conf +++ /dev/null @@ -1,12 +0,0 @@ -[containers] -netns="host" -userns="host" -ipcns="host" -utsns="host" -cgroupns="host" -cgroups="disabled" -log_driver = "k8s-file" -[engine] -cgroup_manager = "cgroupfs" -events_logger="file" -runtime="crun" diff --git a/test/e2e/play_kube_test.go b/test/e2e/play_kube_test.go index 9f74ecc681..7aa3122a5c 100644 --- a/test/e2e/play_kube_test.go +++ b/test/e2e/play_kube_test.go @@ -4388,8 +4388,18 @@ ENV OPENJ9_JAVA_OPTIONS=%q }) It("podman play kube with disabled cgroup", func() { - os.Setenv("CONTAINERS_CONF", "config/containers-cgroup.conf") - err := writeYaml(simplePodYaml, kubeYaml) + conffile := filepath.Join(podmanTest.TempDir, "container.conf") + // Disabled ipcns and cgroupfs in the config file + // Since shmsize (Inherit from infra container) cannot be set if ipcns is "host", we should remove the default value. + // Also, cgroupfs config should be loaded into SpecGenerator when playing kube. + err := os.WriteFile(conffile, []byte(` +[containers] +ipcns="host" +cgroups="disabled"`), 0644) + Expect(err).ToNot(HaveOccurred()) + defer os.Unsetenv("CONTAINERS_CONF") + os.Setenv("CONTAINERS_CONF", conffile) + err = writeYaml(simplePodYaml, kubeYaml) Expect(err).To(BeNil()) kube := podmanTest.Podman([]string{"play", "kube", kubeYaml})