diff options
author | Petr Sakař <petr.sakar@chare.eu> | 2020-11-22 14:01:52 +0100 |
---|---|---|
committer | Petr Sakař <petr.sakar@chare.eu> | 2020-11-22 14:36:40 +0100 |
commit | c989c193bc78cb62c596677869bfa89d1b349bdc (patch) | |
tree | a6a3699ffef9ab27713f850976af969cf22d689f | |
parent | 5292d5a7b85f9d2ae0b2a3734f8ae4baeba80f11 (diff) | |
download | podman-c989c193bc78cb62c596677869bfa89d1b349bdc.tar.gz podman-c989c193bc78cb62c596677869bfa89d1b349bdc.tar.bz2 podman-c989c193bc78cb62c596677869bfa89d1b349bdc.zip |
APIv2 - create container sets wrong entrypoint
use nil instead of empty string as default value for entrypoint in ContainerCLIOpts -
empty string signifies user wants to override image entry point value
Signed-off-by: Petr Sakař <petr.sakar@chare.eu>
-rw-r--r-- | cmd/podman/common/create_opts.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/cmd/podman/common/create_opts.go b/cmd/podman/common/create_opts.go index f34666fff..dc3202c7f 100644 --- a/cmd/podman/common/create_opts.go +++ b/cmd/podman/common/create_opts.go @@ -137,7 +137,7 @@ func ContainerCreateToContainerCLIOpts(cc handlers.CreateContainerConfig, cgroup aliases []string capAdd []string cappDrop []string - entrypoint string + entrypoint *string init bool specPorts []specgen.PortMapping ) @@ -181,13 +181,14 @@ func ContainerCreateToContainerCLIOpts(cc handlers.CreateContainerConfig, cgroup // marshall it to json; otherwise it should just be the string // value if len(cc.Config.Entrypoint) > 0 { - entrypoint = cc.Config.Entrypoint[0] + entrypoint = &cc.Config.Entrypoint[0] if len(cc.Config.Entrypoint) > 1 { b, err := json.Marshal(cc.Config.Entrypoint) if err != nil { return nil, nil, err } - entrypoint = string(b) + var jsonString = string(b) + entrypoint = &jsonString } } @@ -322,7 +323,7 @@ func ContainerCreateToContainerCLIOpts(cc handlers.CreateContainerConfig, cgroup DeviceReadIOPs: readIops, DeviceWriteBPs: writeBps, DeviceWriteIOPs: writeIops, - Entrypoint: &entrypoint, + Entrypoint: entrypoint, Env: cc.Config.Env, Expose: expose, GroupAdd: cc.HostConfig.GroupAdd, |