summaryrefslogtreecommitdiff
path: root/pkg/spec/createconfig.go
diff options
context:
space:
mode:
authormaybe-sybr <58414429+maybe-sybr@users.noreply.github.com>2020-06-30 11:18:29 +1000
committerMatthew Heon <matthew.heon@pm.me>2020-07-06 13:36:00 -0400
commit042675b9b3376eb3960b98aa2298a278ddaecd3e (patch)
treefb75583106e95599abb0c5166620bc3ce25f249c /pkg/spec/createconfig.go
parent0c4a734353eb2d02d1baf16418068edfcdb505de (diff)
downloadpodman-042675b9b3376eb3960b98aa2298a278ddaecd3e.tar.gz
podman-042675b9b3376eb3960b98aa2298a278ddaecd3e.tar.bz2
podman-042675b9b3376eb3960b98aa2298a278ddaecd3e.zip
fix: Don't override entrypoint if it's `nil`
This change ensures that we only override a container's entrypoint if it is set to something other than `nil`. Signed-off-by: Matt Brindley <58414429+maybe-sybr@users.noreply.github.com>
Diffstat (limited to 'pkg/spec/createconfig.go')
-rw-r--r--pkg/spec/createconfig.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/pkg/spec/createconfig.go b/pkg/spec/createconfig.go
index b1d6be016..879c66895 100644
--- a/pkg/spec/createconfig.go
+++ b/pkg/spec/createconfig.go
@@ -287,10 +287,11 @@ func (c *CreateConfig) getContainerCreateOptions(runtime *libpod.Runtime, pod *l
options = append(options, libpod.WithCommand(c.UserCommand))
}
- // Add entrypoint unconditionally
- // If it's empty it's because it was explicitly set to "" or the image
- // does not have one
- options = append(options, libpod.WithEntrypoint(c.Entrypoint))
+ // Add entrypoint if it was set
+ // If it's empty it's because it was explicitly set to ""
+ if c.Entrypoint != nil {
+ options = append(options, libpod.WithEntrypoint(c.Entrypoint))
+ }
// TODO: MNT, USER, CGROUP
options = append(options, libpod.WithStopSignal(c.StopSignal))