summaryrefslogtreecommitdiff
path: root/pkg/spec
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-08-26 13:04:37 -0400
committerGitHub <noreply@github.com>2020-08-26 13:04:37 -0400
commitf99954c7ca4428e501676fa47a63b5cecadd9454 (patch)
tree2e62d26620f7feca4b98d63b56c88fd27d322124 /pkg/spec
parent3a9d5248ac65358e7a4f123c2cdbe93584084d6a (diff)
parentfa6ba6802618e3e23746c4b4707fb403a55514ae (diff)
downloadpodman-f99954c7ca4428e501676fa47a63b5cecadd9454.tar.gz
podman-f99954c7ca4428e501676fa47a63b5cecadd9454.tar.bz2
podman-f99954c7ca4428e501676fa47a63b5cecadd9454.zip
Merge pull request #7409 from zhangguanzhang/apiv2-create-ctr-with-invalid-entrypoint
fix apiv2 will create containers with incorrect commands
Diffstat (limited to 'pkg/spec')
-rw-r--r--pkg/spec/spec.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/pkg/spec/spec.go b/pkg/spec/spec.go
index 893ae3cab..5e97620cc 100644
--- a/pkg/spec/spec.go
+++ b/pkg/spec/spec.go
@@ -180,7 +180,16 @@ func (config *CreateConfig) createConfigToOCISpec(runtime *libpod.Runtime, userM
g.AddMount(cgroupMnt)
}
g.SetProcessCwd(config.WorkDir)
- g.SetProcessArgs(config.Command)
+
+ ProcessArgs := make([]string, 0)
+ if len(config.Entrypoint) > 0 {
+ ProcessArgs = config.Entrypoint
+ }
+ if len(config.Command) > 0 {
+ ProcessArgs = append(ProcessArgs, config.Command...)
+ }
+ g.SetProcessArgs(ProcessArgs)
+
g.SetProcessTerminal(config.Tty)
for key, val := range config.Annotations {