summaryrefslogtreecommitdiff
path: root/pkg/spec/spec.go
diff options
context:
space:
mode:
authorzhangguanzhang <zhangguanzhang@qq.com>2020-08-22 18:15:53 +0800
committerzhangguanzhang <zhangguanzhang@qq.com>2020-08-24 23:07:30 +0800
commitfa6ba6802618e3e23746c4b4707fb403a55514ae (patch)
tree807e78f11803170afec2b27963398218ce1df4d0 /pkg/spec/spec.go
parent4828455055010a1376f1e83832bfa34787f3a1e7 (diff)
downloadpodman-fa6ba6802618e3e23746c4b4707fb403a55514ae.tar.gz
podman-fa6ba6802618e3e23746c4b4707fb403a55514ae.tar.bz2
podman-fa6ba6802618e3e23746c4b4707fb403a55514ae.zip
fix apiv2 will create containers with incorrect commands
Signed-off-by: zhangguanzhang <zhangguanzhang@qq.com>
Diffstat (limited to 'pkg/spec/spec.go')
-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 {