summaryrefslogtreecommitdiff
path: root/pkg/specgenutil/specgen.go
diff options
context:
space:
mode:
authorAditya Rajan <arajan@redhat.com>2021-12-08 17:38:45 +0530
committerMatthew Heon <mheon@redhat.com>2021-12-08 13:39:10 -0500
commite30588a685ad1474e7957912e72c6c9fbdee4105 (patch)
treeabb66f9bea4ba8e93f1bbbbd51a9cf745de2bee5 /pkg/specgenutil/specgen.go
parentdb9caa74b79482b362aab180054e69a08c10d3cd (diff)
downloadpodman-e30588a685ad1474e7957912e72c6c9fbdee4105.tar.gz
podman-e30588a685ad1474e7957912e72c6c9fbdee4105.tar.bz2
podman-e30588a685ad1474e7957912e72c6c9fbdee4105.zip
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 <arajan@redhat.com> <MH: Fixed cherry-pick conflicts> Signed-off-by: Matthew Heon <mheon@redhat.com>
Diffstat (limited to 'pkg/specgenutil/specgen.go')
-rw-r--r--pkg/specgenutil/specgen.go8
1 files changed, 3 insertions, 5 deletions
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
}