Skip to content

Commit

Permalink
Merge pull request #12541 from flouthoc/remote_blank_entrypoint
Browse files Browse the repository at this point in the history
specgen: honor empty args for entrypoint specified as `--entrypoint ""`
  • Loading branch information
openshift-merge-robot authored Dec 8, 2021
2 parents d6079de + b526a0c commit 02eaebd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
8 changes: 3 additions & 5 deletions pkg/specgenutil/specgen.go
Original file line number Diff line number Diff line change
Expand Up @@ -409,11 +409,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
}
Expand Down
1 change: 0 additions & 1 deletion test/e2e/run_entrypoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ ENTRYPOINT ["grep", "Alpine", "/etc/os-release"]
})

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
CMD ["-i"]
ENTRYPOINT ["grep", "Alpine", "/etc/os-release"]
Expand Down

0 comments on commit 02eaebd

Please sign in to comment.