diff options
author | Milivoje Legenovic <m.legenovic@gmail.com> | 2020-12-07 12:50:10 +0100 |
---|---|---|
committer | Matthew Heon <mheon@redhat.com> | 2020-12-07 14:37:01 -0500 |
commit | 9b4266eb942b10926ea69ba13d84d5e36a61bd3c (patch) | |
tree | f65c90a46315f4e41cb675b13cb399d1304dddbe /pkg | |
parent | 4fa94d7e14bcfb41b4a73093f0b08a51469b2c45 (diff) | |
download | podman-9b4266eb942b10926ea69ba13d84d5e36a61bd3c.tar.gz podman-9b4266eb942b10926ea69ba13d84d5e36a61bd3c.tar.bz2 podman-9b4266eb942b10926ea69ba13d84d5e36a61bd3c.zip |
Docker compat API - containers create ignores the name
/containers/create compat endpoint does not set the name correctly (#7857)
Signed-off-by: Milivoje Legenovic <m.legenovic@gmail.com>
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/api/handlers/compat/containers_create.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pkg/api/handlers/compat/containers_create.go b/pkg/api/handlers/compat/containers_create.go index 729639928..409a74de2 100644 --- a/pkg/api/handlers/compat/containers_create.go +++ b/pkg/api/handlers/compat/containers_create.go @@ -37,6 +37,9 @@ func CreateContainer(w http.ResponseWriter, r *http.Request) { return } + // Override the container name in the body struct + body.Name = query.Name + if len(body.HostConfig.Links) > 0 { utils.Error(w, utils.ErrLinkNotSupport.Error(), http.StatusBadRequest, errors.Wrapf(utils.ErrLinkNotSupport, "bad parameter")) return @@ -69,9 +72,6 @@ func CreateContainer(w http.ResponseWriter, r *http.Request) { return } - // Override the container name in the body struct - body.Name = query.Name - ic := abi.ContainerEngine{Libpod: runtime} report, err := ic.ContainerCreate(r.Context(), sg) if err != nil { |