diff options
author | Giuseppe Scrivano <gscrivan@redhat.com> | 2020-04-28 12:20:10 +0200 |
---|---|---|
committer | Giuseppe Scrivano <gscrivan@redhat.com> | 2020-04-30 11:33:34 +0200 |
commit | c11cff4542a3e8b1b14086601b219310ed0f7f1b (patch) | |
tree | e509c794fd6c8b1b553bf78d68927bc7ac515188 /pkg/specgen/generate/container_create.go | |
parent | 32564df172659dd844c0bd72671468f058f964de (diff) | |
download | podman-c11cff4542a3e8b1b14086601b219310ed0f7f1b.tar.gz podman-c11cff4542a3e8b1b14086601b219310ed0f7f1b.tar.bz2 podman-c11cff4542a3e8b1b14086601b219310ed0f7f1b.zip |
cmd, podman: do not override entrypoint if unset
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'pkg/specgen/generate/container_create.go')
-rw-r--r-- | pkg/specgen/generate/container_create.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/pkg/specgen/generate/container_create.go b/pkg/specgen/generate/container_create.go index f04e1548f..14836035d 100644 --- a/pkg/specgen/generate/container_create.go +++ b/pkg/specgen/generate/container_create.go @@ -130,7 +130,7 @@ func createContainerOptions(rt *libpod.Runtime, s *specgen.SpecGenerator, pod *l options = append(options, libpod.WithName(s.Name)) } if pod != nil { - logrus.Debugf("adding container to pod %s", pod.Name) + logrus.Debugf("adding container to pod %s", pod.Name()) options = append(options, rt.WithPod(pod)) } destinations := []string{} @@ -155,11 +155,12 @@ func createContainerOptions(rt *libpod.Runtime, s *specgen.SpecGenerator, pod *l options = append(options, libpod.WithNamedVolumes(vols)) } - if len(s.Command) != 0 { + if s.Command != nil { options = append(options, libpod.WithCommand(s.Command)) } - - options = append(options, libpod.WithEntrypoint(s.Entrypoint)) + if s.Entrypoint != nil { + options = append(options, libpod.WithEntrypoint(s.Entrypoint)) + } if s.StopSignal != nil { options = append(options, libpod.WithStopSignal(*s.StopSignal)) } |