From db9caa74b79482b362aab180054e69a08c10d3cd Mon Sep 17 00:00:00 2001 From: Aditya Rajan Date: Tue, 7 Dec 2021 15:08:52 +0530 Subject: volume: apply exact permission of target directory without adding extra 0111 While trying to match permissions of target directory podman adds extra `0111` which should not be needed if target path does not have execute permission. Signed-off-by: Aditya Rajan --- test/e2e/run_volume_test.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test') diff --git a/test/e2e/run_volume_test.go b/test/e2e/run_volume_test.go index 59937b6c0..eca43680b 100644 --- a/test/e2e/run_volume_test.go +++ b/test/e2e/run_volume_test.go @@ -691,6 +691,18 @@ USER testuser`, fedoraMinimal) }) + It("podman run with named volume check if we honor permission of target dir", func() { + session := podmanTest.Podman([]string{"run", "--rm", ALPINE, "stat", "-c", "%a %Y", "/var/tmp"}) + session.WaitWithDefaultTimeout() + Expect(session).Should(Exit(0)) + perms := session.OutputToString() + + session = podmanTest.Podman([]string{"run", "--rm", "-v", "test:/var/tmp", ALPINE, "stat", "-c", "%a %Y", "/var/tmp"}) + session.WaitWithDefaultTimeout() + Expect(session).Should(Exit(0)) + Expect(session.OutputToString()).To(Equal(perms)) + }) + It("podman volume with uid and gid works", func() { volName := "testVol" volCreate := podmanTest.Podman([]string{"volume", "create", "--opt", "o=uid=1000", volName}) -- cgit v1.2.3-54-g00ecf From e30588a685ad1474e7957912e72c6c9fbdee4105 Mon Sep 17 00:00:00 2001 From: Aditya Rajan Date: Wed, 8 Dec 2021 17:38:45 +0530 Subject: specgen: honor empty args for entrypoint Users should be able to override containers entrypoint using `--entrypoint ""` following works fine for podman but not for podman remote. Specgen ignores empty argument for entrypoint so make specgen honor empty arguments. Signed-off-by: Aditya Rajan Signed-off-by: Matthew Heon --- pkg/specgenutil/specgen.go | 8 +++----- test/e2e/run_entrypoint_test.go | 1 - 2 files changed, 3 insertions(+), 6 deletions(-) (limited to 'test') diff --git a/pkg/specgenutil/specgen.go b/pkg/specgenutil/specgen.go index eba173a81..4db25bef3 100644 --- a/pkg/specgenutil/specgen.go +++ b/pkg/specgenutil/specgen.go @@ -397,11 +397,9 @@ func FillOutSpecGen(s *specgen.SpecGenerator, c *entities.ContainerCreateOptions s.WorkDir = c.Workdir if c.Entrypoint != nil { entrypoint := []string{} - if ep := *c.Entrypoint; len(ep) > 0 { - // Check if entrypoint specified is json - if err := json.Unmarshal([]byte(*c.Entrypoint), &entrypoint); err != nil { - entrypoint = append(entrypoint, ep) - } + // Check if entrypoint specified is json + if err := json.Unmarshal([]byte(*c.Entrypoint), &entrypoint); err != nil { + entrypoint = append(entrypoint, *c.Entrypoint) } s.Entrypoint = entrypoint } diff --git a/test/e2e/run_entrypoint_test.go b/test/e2e/run_entrypoint_test.go index 9560b1627..2246da104 100644 --- a/test/e2e/run_entrypoint_test.go +++ b/test/e2e/run_entrypoint_test.go @@ -103,7 +103,6 @@ ENTRYPOINT ["grep", "Alpine", "/etc/os-release"] }) It("podman run user entrypoint overrides image entrypoint and image cmd", func() { - SkipIfRemote("FIXME: podman-remote not handling passing --entrypoint=\"\" flag correctly") dockerfile := `FROM quay.io/libpod/alpine:latest CMD ["-i"] ENTRYPOINT ["grep", "Alpine", "/etc/os-release"] -- cgit v1.2.3-54-g00ecf