Fix handling of command in images

Currently we are dropping the command entry from the create
line and using the image Cmd.  This change will only use the
image Cmd if the user did not specify a Cmd.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #823
Approved by: umohnani8
This commit is contained in:
Daniel J Walsh
2018-05-23 11:33:22 -04:00
committed by Atomic Bot
parent 5f0d4b10e9
commit 05bc77f0cb

View File

@ -243,7 +243,9 @@ func (c *Container) setupStorage(ctx context.Context) error {
// Set the default Entrypoint and Command // Set the default Entrypoint and Command
c.config.Entrypoint = containerInfo.Config.Config.Entrypoint c.config.Entrypoint = containerInfo.Config.Config.Entrypoint
c.config.Command = containerInfo.Config.Config.Cmd if len(c.config.Command) == 0 {
c.config.Command = containerInfo.Config.Config.Cmd
}
artifacts := filepath.Join(c.config.StaticDir, artifactsDir) artifacts := filepath.Join(c.config.StaticDir, artifactsDir)
if err := os.MkdirAll(artifacts, 0755); err != nil { if err := os.MkdirAll(artifacts, 0755); err != nil {