Merge pull request #9404 from rhatdan/entrypoint

Ignore entrypoint=[""]
This commit is contained in:
OpenShift Merge Robot authored and GitHub committed 2021-02-17 09:55:32 -05:00
commit 2e522ff29c
2 files changed
+16 -1

No files matched your search

+4 -1
View File
@@ -105,7 +105,10 @@ func makeCommand(ctx context.Context, s *specgen.SpecGenerator, img *image.Image
entrypoint = newEntry
}
finalCommand = append(finalCommand, entrypoint...)
// Don't append the entrypoint if it is [""]
if len(entrypoint) != 1 || entrypoint[0] != "" {
finalCommand = append(finalCommand, entrypoint...)
}
// Only use image command if the user did not manually set an
// entrypoint.
+12
View File
@@ -43,6 +43,18 @@ CMD []
Expect(session.ExitCode()).To(Equal(125))
})
It("podman run entrypoint == [\"\"]", func() {
dockerfile := `FROM quay.io/libpod/alpine:latest
ENTRYPOINT [""]
CMD []
`
podmanTest.BuildImage(dockerfile, "foobar.com/entrypoint:latest", "false")
session := podmanTest.Podman([]string{"run", "foobar.com/entrypoint:latest", "echo", "hello"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
Expect(session.OutputToString()).To(Equal("hello"))
})
It("podman run entrypoint", func() {
dockerfile := `FROM quay.io/libpod/alpine:latest
ENTRYPOINT ["grep", "Alpine", "/etc/os-release"]