mirror of
https://github.com/containers/podman.git
synced 2025-06-13 11:44:19 +08:00
Merge pull request #12541 from flouthoc/remote_blank_entrypoint
specgen: honor empty args for entrypoint specified as `--entrypoint ""`
This commit is contained in:
@ -409,11 +409,9 @@ func FillOutSpecGen(s *specgen.SpecGenerator, c *entities.ContainerCreateOptions
|
|||||||
s.WorkDir = c.Workdir
|
s.WorkDir = c.Workdir
|
||||||
if c.Entrypoint != nil {
|
if c.Entrypoint != nil {
|
||||||
entrypoint := []string{}
|
entrypoint := []string{}
|
||||||
if ep := *c.Entrypoint; len(ep) > 0 {
|
// Check if entrypoint specified is json
|
||||||
// Check if entrypoint specified is json
|
if err := json.Unmarshal([]byte(*c.Entrypoint), &entrypoint); err != nil {
|
||||||
if err := json.Unmarshal([]byte(*c.Entrypoint), &entrypoint); err != nil {
|
entrypoint = append(entrypoint, *c.Entrypoint)
|
||||||
entrypoint = append(entrypoint, ep)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
s.Entrypoint = entrypoint
|
s.Entrypoint = entrypoint
|
||||||
}
|
}
|
||||||
|
@ -103,7 +103,6 @@ ENTRYPOINT ["grep", "Alpine", "/etc/os-release"]
|
|||||||
})
|
})
|
||||||
|
|
||||||
It("podman run user entrypoint overrides image entrypoint and image cmd", func() {
|
It("podman run user entrypoint overrides image entrypoint and image cmd", func() {
|
||||||
SkipIfRemote("#12521: podman-remote not handling passing empty --entrypoint")
|
|
||||||
dockerfile := `FROM quay.io/libpod/alpine:latest
|
dockerfile := `FROM quay.io/libpod/alpine:latest
|
||||||
CMD ["-i"]
|
CMD ["-i"]
|
||||||
ENTRYPOINT ["grep", "Alpine", "/etc/os-release"]
|
ENTRYPOINT ["grep", "Alpine", "/etc/os-release"]
|
||||||
|
Reference in New Issue
Block a user