Skip to content

Commit

Permalink
fix: Don't override entrypoint if it's nil
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
maybe-sybr committed Jun 30, 2020
1 parent b163ec3 commit aa69e68
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pkg/spec/createconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit aa69e68

Please sign in to comment.